A train driver three seconds away from being hit by a train travelling at 85mph lay down on railways tracks to avoid it.
The driver had thought the track next to him was "blocked to train movements" after talking to signal staff, the Rail Accident Investigation Branch said.
He had stopped his Virgin Train outside Stafford station to check a fault with brakes.
He was unhurt but "shaken" after the near miss, the report said.
The Virgin Trains driver had got out of the cab of the 12.35 Manchester to London Euston train, known as number 1A34, to carry out a brakes inspection on the afternoon of 2 March.
The oncoming driver, also from Virgin Trains, was on the neighbouring northbound line and sounded his horn after spotting the driver.
The report stated: "While on the track and working on his train, he saw a train approaching at speed on the adjacent northbound line and had to take evasive action, lying down on the track next to his train, to avoid being struck.
"The driver was not injured but was badly shaken by the incident.
"The driver of train 1A34 returned to his driving cab and confirmed that he would remain there until a relief driver arrived. Although shaken, the driver of the other train was fit to continue his journey."
Priti Patel, head of safety, health & environment for Network Rail, said: "The safety of passengers and the railway workforce is our priority.
"As soon as this incident occurred we immediately launched our own investigation, working with Virgin Trains.
"Since the incident, we have thoroughly reviewed our existing procedure reinforcing the importance of signallers and train drivers reaching a clear understanding when a driver needs to arrange protection to get down onto the track and examine their train."