But the authority dismissed his appeal.
He appealed that decision to the Employment Court, which recently released its decision.
Mr Thorne told the court the crash happened because the brakes on the train had failed.
"At around 100-200m from Melling Station, I did not believe the train would stop in spite of all brakes applied so I opened the cab door and warned the passengers to brace themselves," he said in an incident report.
Following the collision, at a meeting between KiwiRail and Mr Thorne's lawyer, he admitted to smoking a cannabis cigarette 11 days before the incident, the decision said.
A Trans Metro roster produced in evidence showed that Mr Thorne had operated passenger trains about 30 occasions during the 11-day period between 16 May, when he smoked the cannabis, and the accident at Melling Station on 27 May, the decision said.
Employment Court judge Anthony Ford said KiwiRail's clear "overriding concern" was the fact that given Mr Thorne's employment history, his seniority and length of service, the company ought to have been able to trust Mr Thorne to observe its Drug and Alcohol Policy but he let them down.
"KiwiRail concluded, after its disciplinary investigation, that they could no longer have trust and confidence in Mr Thorne."
As a train driver, the well-being and lives of others were placed in his hands and judgment, Judge Ford said.
"KiwiRail recognised that and they were not prepared to take any more risks. They terminated his employment."
He said Mr Thorne's dismissal was justified and ordered him to pay costs to KiwiRail that they would both agree to.