I'm not an expert on mental health, but I think the purpose of the second person in the cockpit is simply for the presence of another human - they don't need to be a trained pilot, or need to be able to fight off a physical attack. As noted above, we don't know exactly what happened in the cockpit of most of these flights (apart from Germanwings), but it's easy to see that it requires a different mental state to turn around and attack your colleague than it does to calmly change an auto-pilot setting. Just having someone there to say "Think about the consequences of what you're doing" could be enough to change the intention of a suicidal depressive.