As the other poster said, the main need for humans is to fix mechanical problems. If the door jams, unjam it (why can't passengers use a different door or figure out how to unjam it>) If someone is having a heart attack do CPR until medical crew arrives, then stop the train until the medical crew is off (central dispatch can teach anyone CPR over the phone and stop the train). If someone is attacked - stop the the attack (unless you are a trained police office you will probably make the situation worse trying to stop an attack)
In short there actually isn't that much that a human can do that a computer cannot do better.
Passengers fixing their own doors and responding to their own emergency alarms doesn't fit most people's definitions of "better". Hence why even though train automation has been possible for decades, most trains and especially most trains travelling long distances aren't.
I don't follow. As Animats indicated, there are already plenty of autonomous trains that work fine.
Imagine a door gets jammed or there are some problematic passengers. If there is someone on board they can fix the problem in a couple minutes. But on a completely automated train there is no one on board to fix the problem. One solution would be that you send out crews to arrive at smaller stations and fix the issue, and larger stations could have dedicated people, but that is already more investment and less efficient than just having someone on board.
Retrofitting automation for a train network in a wealthy country like Switzerland wouldn’t be a big problem, but it just makes more sense to leave the driver in there. Accordingly, SBB is investing much more into driver augmentation to help the drivers drive as efficiently, safely, and consistently as possible.
Has it been done on anything more complex than 100% underground subway line with the train just going back and forth?