This is a solved problem. It's called trains.
Visit Switzerland and you'll see that it is superfluous to build all this expensive infrastructure just to stick your personal car on a train.
Riding in a train is bigger, way more comfortable, and much cheaper.