THE East Coast mainline is Britain’s most scenic long-distance railway. Connecting London to Edinburgh and the Scottish highlands, the view of Durham’s medieval castle from the line’s tall viaduct running through the city is one of Europe’s best. The business of running the line’s finances is less pretty, however.

On February 5th Chris Grayling, the transport secretary, announced that Virgin East Coast, the franchisee that operates trains on the line for the government, is near collapse. Passenger numbers and revenues have undershot forecasts since the eight-year contract began in 2015. As a result, the firm is running out of money. Virgin East Coast is not the only franchisee that has faced financial ruin running the line. Previous operators forfeited their contracts in 2007 and 2009 after revenues failed to meet forecasts. But this time the crisis comes at an awkward moment for the government. Rising rail fares and poor service quality on some lines have dented public support for rail privatisation. Some 60% of Britons now support a return to state ownership, according to a poll published last month by Sky, a broadcaster. The Labour Party will use any sign of a bail-out as ammunition for its campaign to renationalise the railways.

In the past, the state has often helped struggling franchisees, allowing them to renegotiate terms midway through their contracts. But Andrew Adonis, a former chairman of the National Infrastructure Commission, claims that this encourages other operators to seek similar treatment, blowing a hole in the government’s rail budget. When National Express East Coast defaulted when he was a Labour transport secretary in 2009, he renationalised the line. He says that Virgin East Coast’s franchise should also be taken back by the government and its owners, Stagecoach and Virgin Group, banned from future bids.

The government is not keen on that. There is already a shortage of competition for rail franchises. The two awarded last year only attracted two bidders each. Instead it wants to push Stagecoach and Virgin hard enough to show others it will not reward failure, without pushing them out of the industry. The two firms will lose £165m ($230m) in parent-company guarantees for ending the contract. Stagecoach may lose another £94m in performance payments and assets in the subsidiary.

Neither is the government convinced about the benefits of state ownership. Since the East Coast mainline was reprivatised in 2015, it has produced 30% more in payments to the government than its nationalised predecessor did. Returning it to state ownership would have significant startup costs. Mr Grayling has not ruled this out, but he hopes that a new not-for-profit contract with Virgin, whereby the company could keep some of the assets that it might forfeit if it loses the present deal, could offer taxpayers better value.

Last year Virgin East Coast was one of only two franchisees that paid more money to the government than it received. The problem is that the way franchises are awarded incentivises overbidding and the subsequent collapse of the contracts. Fiddly changes to this process, such as using less optimistic passenger forecasts, could help. But given the mind-boggling complexity of these deals, simple solutions such as nationalisation have captured the public mood.