> It could work very well for trains.
Only if you completely ignore overhead wires. Electrifying main rail corridors is a no-brainer, and batteries are more than sufficient for short last-mile spurs.