Passengers on commuter trains across England and Wales are set to benefit from "radically improved" mobile broadband access as a result of government-owned Network Rail being fined for late running trains.
Under the proposals, more than £53 million will be invested in fitting out trains with new WiFi equipment, the government said.
This will enable passengers to receive "seamless" mobile broadband connections, said the Department for Transport. They will receive broadband speeds equivalent to those available at stations and off the railway, and "at least ten times better than services they currently experience", the DfT said.
The funding comes from money that Network Rail has been required to return to the government for missing punctuality targets set by the Office of Rail Regulation. It is the first time the money has been reinvested into improvements targeted at passengers.
Transport secretary Patrick McLoughlin said: "We all know how frustrating it can be to have our phone calls and internet use constantly disrupted by poor signals while travelling on trains. At the moment it happens too often. Passengers expect and deserve better and with these plans, that is what they'll get."
He said: "The work will complement an upgrade currently taking place on Network Rail's trackside infrastructure to ensure that a good signal is available up and down the busiest rail routes."
The funding will be targeted at commuter and metropolitan services, with those likely to benefit including passengers on routes into London from Bedford, Brighton, Kent and Portsmouth as well as services into Manchester, Leeds and Sheffield.
Transport minister baroness Kramer said: "The announcement that we are providing free wifi on trains means people can more easily work and keep up with friends while on journeys.
"We hope free wifi will encourage even more people to make the greener choice and travel by train."
Passengers will be interested to find out whether the £53 million to upgrade train equipment really will lead to "free" wifi access, when most train operators currently charge for it outside first class carriages.
Before the East Coast Line was re-nationalised after operating failures by the franchisee operator, there was free wifi for all passengers - if unreliable. Those outside first class now have to pay for it, but that line is now being handed to the private sector again.
Sign up for CIO Asia eNewsletters.