On the man's assurance, a passenger train travelling from Waikanae to Wellington was given permission to enter the area.
As it rounded a curve travelling at about 60 km/h the driver saw the two workers still on the track about 90 metres ahead.
"He sounded the train whistle and applied maximum braking. The track workers managed to leap clear of the track just before the train passed. Neither was injured," the report said.
The commission found several faults leading up to the incident.
Planning of the work and a communication plan did not match KiwiRail procedures.
The work group also lacked experience in planning and carrying out the work that day, and staff competency records were incomplete, said the commission.
It made several recommendations to the NZ Transport Agency to ensure KiwiRail's safety system for proving staff competencies is accurate and up to date, and to develop an industry standard requiring a zero tolerance drug and alcohol policy.
Also recommended were post-incident random testing for drugs and alcohol, and the development of a system for workers to discreetly report co-workers suspected of using or being under the influence of drugs or alcohol in the workplace.