WiFi at a stop is as easy as putting up a few wireless routers, it's a bit more complex than at home but the same general idea.
Wifi inside the trains involves much more work, and to get them to ALSO be seamless across the entire setup - even harder. Easily 10x or 100x the cost.
It's sad, because the Internet shouldn't be that bad when the network drops all the time; it should just be slower as it waits to send good data.