but I don't see why building a train shouldn't be a good way to get to C without going through B.
If you can simply drive around B this should of course be possible (even though it would take you longer). But let's assume B borders to the ocean to the east and west and A and C are competely isolated from each other. Wouldn't it be strange if A could build a railway track to C through Bs territory, without B being able to do something about it?
A train could choose to go to any connected station, unless one of the stations it passes through has been set to not allow trains to go through
This would mean that you would be able to see the whole railway network when you pick a destination, which doesn't seem like knowledge a character should be supposed to have.
What I had in mind was to have a switch for each track at every station that could be used to auto-refer incoming trains to another track. Your character would for example leave A City on the second track to B-ington. There, incoming trains on this track would, according to the switch setting, be relayed to the first track to C-ville, where the train would be relayed to D-polis where it would stop, since no relay destination was set. This system would require the driver of the train to know exactly which track will lead him where and trust the personel of the intermediary stations not to randomly switch settings.
Actually, since a train would have the option to stop manually at the next station, switch settings could even be the only way to direct a train. In the worst case the driver would have to step out, change the switch himself and continue his journey.
This method would require cooperation and organisation on an supraregional level, which is exactly what we want in this game. It also sounds much more interesting than just picking a destination.

Pretty in pink.