The problem is automatizing the existing infrastructure, 'cause it requires great effort (so, money and inconveniences).
I don't think however that the lessons there are applicable to cars as well, and while I think we could and should invest a lot on train systems, the final goal for cars should be reducing them, not replacing them with autonomous systems.
I don't follow. As Animats indicated, there are already plenty of autonomous trains that work fine.
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.
Has it been done on anything more complex than 100% underground subway line with the train just going back and forth?
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.
Traditional lineside signals and signs do give enough information to drive a train by a computer, but the rail industry has already chosen decades ago to integrate signalling and automation with the infrastructure, which is a completely different approach than today's self-driving cars. As a result, heavy rail and metro trains will not be "self-driving" in the same way as self-driving cars.
Now, if you say trams that run on streets, then possibly. Trams are often driven by sight and has stronger braking so it is possible to apply the same principles from self-driving cars. In fact, Siemens has been developing and testing one such tram. [1] Though I think the problem space is very similar to self-driving cars. There is no steering, but it still has to handle pedestrians and other road traffic.
[1]: https://www.mobility.siemens.com/global/en/portfolio/rail/ro...
Political: union strikes (meaning if you want to automate a line you may have to accept it being closed for the duration) and public outcry over a reduction in jobs.
Cost: You often only get the benefit of the simpler domain if you can implement the whole system from scratch, if you have to deal with the existing signalling, engines, (and human-driven trains) that's a complex problem, with massive capital outlay.
For local public transit subway (ny mta, path ny nj), I think the cost is worth it if it means fewer delays.
https://www.republicworld.com/world-news/australia/australia...
https://en.wikipedia.org/wiki/List_of_automated_train_system...
Other than that isn't there in London a autonomous train? I remember riding that in 2005 or so
I think that automation is possible because it was built de novo and doesn't interface with the rest of the rail network.
Automated trains do have difficulties, but they are very different from the ones you see with human drivers.