Rail workers were subjected to unsafe working conditions after being forced to scramble for their lives following a near miss on the East Coast Main Line.
A report commissioned by the Rail Accident Investigation Branch said workers at Egmanton level crossing used an unofficial system of work that put their lives at risk.
The investigation followed an incident on October 5 last year, where workers took evasive action to avoid a high-speed passenger train travelling at 125mph.
At around 11.22am, the train driver saw a group of track workers on the line and sounded the warning horn, but saw no response from the group.
Video recorded from the train’s cabin showed the track workers becoming aware of the train three seconds before it reached them.
One of the group shouted a warning and three workers jumped clear of the track around one second before the train passed.
The driver had continued to sound the horn and hit the emergency brake, with the train coming to a complete stop 0.75 miles away near Tuxford.
An investigation found the person in charge of the group had put in place an unofficial system of work to maximise working time on the track.
Instead of moving off the track when the automated Train Operated Warning System was activated, they used it as a cue for a lookout to start looking for approaching trains.
The unsafe system of work broke down when both the lookout and the person in charge became distracted and forgot about the warning system alerting them of a train.
The investigation found that although the person in charge was qualified and experienced, neither his training nor reassessment had instilled an adequate regard for safety and the importance of following the rules and procedures.
Additionally, none of the team involved challenged the unsafe system of work that was in place at the time.
Even though some were uncomfortable with it, they feared they might lose the work as contractors if they challenged the person in charge.
The report recommended that Network Rail looked at how it monitored and managed the safety leadership exercised by its staff, and how they interacted with contractors.
Simon French, chief inspector of rail accidents, said: "When the person in charge of a team is both a strong personality and an employee of the client, it can be particularly hard for contract workers to challenge unsafe behaviour.
"This came so close to being a major tragedy.
"We have seen this sort of unsafe behaviour before, where the wish to get the work done quickly overrides common sense and self-preservation.
"When we see narrowly avoided tragedies of this type it is almost always the result of the adoption of an unsafe method of work and the absence of a challenge from others in the group.
"There have been too many near misses in recent years.
"It takes effective leadership and a positive safety culture to create a working environment in which everyone can be confident that safety will come first."