Picture: Jane Barlow

However, it has now emerged that he resigned from the company in 2010 after failing another routine test. He is believed to have challenged the latest test result, which is believed to be highly unusual.

Industry sources expressed surprise that he had been re-employed by the train operator after failing a test. It is believed he was caught during routine health screening as part of his application to become a train conductor.

He is understood to have been working for ScotRail as a train ticket examiner at the time.

The man is believed to have gone on to become a driver at First Great Western (FGW) in England before returning to ScotRail where he continued to drive trains, and is now based in Aberdeen.

Until 2015, FGW was ScotRail’s sister company as part of Aberdeen-based FirstGroup.

The earlier failed test has been confirmed to The Scotsman after several people contacted the newspaper following our revelation last week that the driver had failed a drugs test this month. He fell foul of a standard drugs and alcohol check following the derailment at Stonehaven in Aberdeenshire.

No passengers were aboard the train and it was travelling at less than the speed limit, and did not pass a red signal.

However, the incident closed the Dundee-Aberdeen line for two days, forcing the cancellation of dozens of trains which caused widespread disruption for thousands of passengers.

British Transport Police (BTP) said it was caused by a points failure and “no evidence of criminality was identified”.