The funding will benefit passengers on routes into London from Bedford, Brighton, Kent and Portsmouth, as well as services into Manchester, Leeds and Sheffield.
This investment will come from Network Rail, which has been recently fined £53m for failing to meet punctuality targets set by the Office of Rail Regulation.
UK Transport Minister Susan Kramer said: "The coalition government is working hard to build a stronger economy and fairer society. The announcement that we are providing free Wi-Fi on trains means people can more easily work and keep up with friends while on journeys."
"As well as the steps we have already taken to make train travel as affordable and efficient as possible, we hope free Wi-Fi will encourage even more people to make the greener choice and travel by train."
The work will complement an upgrade that is currently underway on Network Rail’s trackside infrastructure to ensure a good signal is available on the rail routes.
UK 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 signal 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."
Image: UK DfT to invest in the installation of new Wi-Fi equipment on rail routes. Photo: courtesy of UK DfT.