KiwiRail says is introducing random alcohol and drug tests for all staff.
Two workers repairing rail track between Paekakariki and Wellington in 2011 were nearly hit by a train after the site's protection person failed to check the track before allowing it to pass through.
The Transport Accident Investigation Commission's report into the incident says the worker who failed to check was a regular cannabis user and had traces in his system after the incident.
KiwiRail chief executive Jim Quinn said on Thursday that pre-employment and post-incident alcohol and drug tests have been in place for some time.
Mr Quinn said about 500 out of the company's 4000 workers will be randomly tested yearly from 1 June, but the testing is not in response to the 2011 incident.
"This is just an incident that only exacerbates the reason. We've been raising the random drug and alcohol as we continue to lift the bar to make it difficult for people to want to be here if they are here, and certainly make it difficult for somebody to want to come here."
Jim Quinn says about 500 out of the company's 4000 workers will be randomly tested every year. Pre-employment testing will continue, as will testing after something goes wrong.
The commission recommended random testing to KiwiRail and said there should be zero tolerance of performance-impairing substances in the industry.
It also found that the work group had insufficient experience for the work that day.