KiwiRail is doubling its drug testing regime from next month after a railway official who tested positive for methamphetamine was implicated in a dangerous threat to railway workers on the main trunk line in December 2015.
The railway workers were replacing sleepers on the main trunk line on a bridge between Manunui and Taumarunui, under guidance from a rail protection officer.
That officer ensured that four approaching freight trains were halted to ensure the workers' safety.
But a fifth vehicle, a passenger train, was allowed to carry on towards where the men were working.
The driver was able to see the workers and the train stopped 72m short of the bridge.
No one was hurt but the Transport Accident Investigation Commission (TAIC) still took a serious view of the incident.
In an official report, it said the rail protection officer at the site should have stopped the passenger train from getting as far as it did.
It blamed his inaction on a lapse of memory influenced by the pressures of work.
But TAIC also said it was unacceptable under any circumstances for workers to be affected by performance-impairing substances.
It also questioned the level of drug and alcohol testing carried out by KiwiRail.
"KiwiRail's practice of randomly testing 10 percent of its workforce annually means that an individual is potentially tested once every 10 years," TAIC wrote.
"The more likely staff are to be tested, the bigger the deterrent.
"Comparative rail companies in Australia are testing at higher ratios, with some achieving a 50 percent testing programme within a 12-month period."
TAIC went on to recommend that KiwiRail increase the frequency of drug and alcohol testing and KiwRail responded by doubling its rate of testing.
KiwiRail won't say what happened to the employee at the centre of this event.
"Any disciplinary action taken as a result of the incident is confidential to KiwiRail and the employee," the company said.
But the TAIC report gave some details of his drug use.
It said he was struggling to cope with his responsibilities at work, and had been badly affected by the death of a close friend three weeks earlier.
He had started inhaling methamphetamine during the last months of his friend's life, and last smoked it three days before the incident on the rail track.
It said the time lapse meant he was unlikely to have been affected by the drug at the time of the incident, but he might have been under its influence in the days leading up to it.
TAIC noted this was the fourth time a person had tested positive for drugs in a railways incident.
The others were at North Junction near Wellington in August 2011, at Melling in the Hutt Valley in May 2014 and Morningside in Auckland in January 2015.
TAIC added it already had a zero tolerance policy in place for drug or alcohol use by people in safety-critical roles.