Network Rail was warned about the network’s resilience to severe weather just four weeks before the Aberdeenshire derailment.

An annual health and safety report by the Office of Rail and Road (ORR) said there were six times more flooding events on Britain’s railways in 2019-20 than during the previous 12 months.

It also noted a spike in landslips, demonstrating the “vulnerability” of the network.

The ORR found Network Rail’s plans to address climate change and extreme weather are “not keeping up with the frequency and severity of these events”.

Speaking when the report was published last month, HM chief inspector of railways Ian Prosser said: “The last year saw significant increases in flooding, earthwork failures and trains striking trees on the line, which had a big impact on the number of delays on the network.

“It is so important that the sector employs best practice if we are to meet all the pressures on the network in the future and to make sure the railway plays its full role on climate change and reducing carbon emissions.”

In its response, Network Rail said the railway was designed for a temperate climate and is “challenged” by prolonged periods of high and low temperatures, storms and floods.

It added: “Our climate is changing and we’re seeing more and more of these types of incidents.

“We are acutely aware they must be addressed and we have drawn up comprehensive plans to do so.

“There is no quick fix but we will continue to review the way the railway operates in extreme weather and build resilience into all of our plans.”

A train derailed near the site of Wednesday’s crash in October 2018.

No-one was injured but the incident caused major disruption to travel.

Philip Sherratt, editor of magazine Modern Railways, told the PA news agency that an increasing number of landslips are “something that the railways are going to have to deal with”.

He said: “During the storms back in February and March, particularly in the south-east of England, there were several quite severe landslips and you had routes closed for a matter of weeks requiring repair.

“If you look back 10 years that’s not something that we really saw very much so I think there has definitely been a noticeable change in the frequency of these kind of incidents and some are easier to deal with than others.”