Decision comes after he predicted he would be sacked from both roles ‘within days’

Sir Terry Morgan, the chairman of Crossrail and HS2, who last week predicted he would be sacked from both roles “within days” due to delays and cost overruns, has resigned.

The Department for Transport said Morgan, who became chairman of Crossrail in 2009 but had been in charge of HS2 for only four months, had stepped down from the senior posts.

Morgan had become embroiled in a public row with the London mayor, Sadiq Khan, over Crossrail, an east-west railway through the capital that was due to open this year but is now delayed until 2019.

The pair clashed after Morgan claimed Khan knew as early as late July that Crossrail would not be ready on time. The mayor insisted he did not know of the delay until shortly before the postponement was announced on 31 August. The estimated final cost of Crossrail has ballooned this year by £600m to £15.4bn, forcing Transport for London (TfL) to borrow £350m.

Whitehall sources said the increase, announced shortly after Morgan took over at HS2, was among factors that convinced the government he was the wrong man to lead the construction of the UK’s second high-speed rail line.

Morgan said last week that he expected to be sacked within days, just four months after the transport secretary, Chris Grayling, said he would bring “world-class leadership” to the high-speed rail project.

HS2 is slated to cost £55.7bn but has been subject to criticism and mounting concerns about cost overruns such as those that have dogged Crossrail. It is believed that Grayling and the chancellor, Philip Hammond, have since declared they have no confidence in Morgan’s chairmanship and urged the prime minister to remove him.

Grayling said: “Sir Terry has been an integral part of Crossrail for almost a decade and I would like to thank him for his dedication and the expertise he brought to the role. I am also grateful to him for his work as chair of HS2 Ltd.”

The shadow transport secretary, Andy McDonald, said: “While the boss of HS2 has resigned, passengers and taxpayers will be asking why the transport secretary, Chris Grayling, has not accepted any responsibility and why he is still in post.

Sign up to the daily Business Today email or follow Guardian Business on Twitter at @BusinessDesk

“Once again the Tories are proving themselves incapable of providing the leadership to deliver infrastructure investment on time or on budget.”

Morgan will be replaced at HS2 by Allan Cook, a chartered engineer, former chief executive of Cobham and former government adviser.

“It is a privilege to be asked to take on this crucial role on the UK’s biggest infrastructure project,” Cook said. “HS2 will transform Britain through the creation of jobs and skills across UK industry. It will improve connectivity and passenger experience as well as creating value for the UK economy.”

A successor at Crossrail, which is overseen by Transport for London, is yet to be found.