Network Rail has been fined more than £50m by the regulator for causing trains to run late – with the Treasury pledging to plough some of penalty back into the railways to provide faster Wi-Fi on commuter trains.

The Office of Rail Regulation (ORR) has slapped a £53.1m fine on the track operator, the biggest it has yet levied for missing targets.

Last year, almost one in six long-distance trains ran late, nearly twice as many as permitted by the 92% punctuality target. More than one in 10 commuter trains in London and the south-east ran late, where the target was 93%.

The ORR review of how Network Rail spent its budget over the last five years praised the operator for much of its work, including the upgrading of much of the railway and the closure unsafe level crossings. But the regulator said NR "fell significantly short" in ensuring the punctuality of long-distance trains.

Both East Coast and Virgin trains were particularly affected. The ORR said that while extreme weather had played a part, "Network Rail did not deliver all of its plans to improve performance and, particularly in the early years of the funding period, had insufficient knowledge of the condition of its key assets, such as earthworks, electrical equipment and drainage".

NR has pledged to spend an extra £25m to improve the resilience of the south-east commuter network.

The government said some of the fine would go towards improving Wi-Fi, with trackside equipment being put in place by NR over the next three to four years to provide a faster service.

The service, costing around £90m, is expected to be free for passengers and should increase broadband speeds by 10 times. Passengers on routes into London from Bedford, Brighton, Kent and Portsmouth and services into Manchester, Leeds and Sheffield were likely to benefit.

Unions have denounced the move. The RMT acting general secretary, Mick Cash, said: "The public need to be aware of the brutal fact that the fine will come straight out of safety-critical maintenance and renewals budgets and diverted into the pockets of the greedy private train companies to finance Wi-Fi services on their trains."

Manuel Cortes, the leader of the TSSA rail union, said it was "yet another example of the crazy-money merry-go-round that is at the heart of our fragmented rail industry".

Train operators, however, said it was a "positive sign of how the system can work for passengers".

Michael Roberts, the director general of the Rail Delivery Group, said: "Equally important is the joint commitment of train operators and Network Rail to raise our game on punctuality. By working together to improve the physical and operational reliability of the track, trains and other parts of our network, we aim to make Europe's best railway even better."

The ORR chief executive, Richard Price, said more preventative work was needed to ensure the railway remained resilient.

"Network Rail has been successful in modernising and improving Britain's railways over the past five years, during a period which has seen a record rise in passengers numbers," he said. "The company must do more to 'predict and prevent' problems on the network before they create disruption for passengers – enhanced asset management, planning and delivery of maintenance, renewal, and resilience works are vital."

Mark Carne, the NR chief executive, said getting train reliability back on track was a "key priority", but the introduction of more services to meet passenger demand was causing congestion.

"We accept that we have fallen short of the regulatory targets for train punctuality and that this is, in part, down to our failure to reduce infrastructure faults quickly enough," he said. "At the same time, the sharp increase in passenger demand has led us to run more trains at peak times, even when we know this will lead to a more congested railway and that punctuality may suffer.

"Passengers do want trains to run on time, but for many of them the more pressing priority is increased services with less crowding. The trade-off between congestion and punctuality is something we face every day."