WHEN Virgin Rail lost its West Coast Main Line franchise in August, Sir Richard Branson, the firm's boss, criticised FirstGroup's winning bid as "insane" and filed a legal challenge. It seemed like sour grapes, but he can now feel vindicated. On October 3rd Patrick McLoughlin, the new transport secretary, announced that his department had made a mistake. It seems the numbers did not add up. The fault, says Mr McLoughlin, lies "wholly and squarely" with the civil servants of the Department for Transport, who failed to take into account inflation and rises in passenger numbers. The bids themselves may have been fine, but the government's evaluation of them was flawed. Until the department understands what went wrong, all other outstanding franchise competitions are on hold. A review explaining the mistake should be completed by the end of the month. A more ambitious report from Richard Brown, chairman of Eurostar, will examine how all franchise bids are appraised. The Department for Transport plans to reimburse the bidders for the 15-month tender process, at a cost to taxpayers of at least £40m ($64m). The fiasco could also lead other companies to question past franchise awards. "It's going to cost us a lot of money," Mr McLoughlin concedes. It also puts FirstGroup in a tight spot - shares swiftly plummeted by 20%. Virgin may be asked to maintain its west-coast service, at least for the time being. Ed Miliband, Labour's leader, was quick to call this "another hopeless shambolic piece of incompetence" from the government. He says the civil service has been made a scapegoat - three officials have been suspended. That may not be fair: if civil servants did simply botch the calculations, ministers can hardly be blamed. Mr Miliband's apparent solution, to renationalise the railways, is not realistic. But the government will suffer nonetheless. When an official lost the personal details of millions of child-benefit claimants in 2007, Gordon Brown, the then prime minister, apologised to Parliament. And any fundamental problem with the franchise competitions cannot be blamed on officials. The system has been changed in a way that seems to encourage bold bids while providing few penalties for failure. FirstGroup pledged to pay the government £13.3 billion over 15 years. Abandoning the franchise - as two companies did on the east-coast line - would have resulted in costs of just £265m. Competitions require bidders to predict revenue growth over 15 years. This is nearly impossible given the variability of demand (at the mercy of fuel prices and the economy) and the limited control train operators have over costs, which continue to rise steadily. Because the government mandates everything from train times to many ticket prices, operators of railway lines have few levers to pull in response to market fluctuations. With more room for manoeuvre, predictions of both revenue and risk might become more rational.