A logging train derailment that killed three people and injured two others was caused by faulty and poorly installed equipment on the tracks, an investigation has found.

WorkSafeBC​ also found a failsafe train derailer that should've stopped the runaway train didn't work, allowing nearly a dozen out-of-control cars to crash into a maintenance crew in Woss, B.C., more than a year ago.

"It was a horrific event," said Chris Cinkant, a safety officer for United Steelworkers union.

The report, published Tuesday, concluded Western Forest Products Inc. — which owned and operated the now-closed rail line — failed "to ensure the health and safety of all workers" working on the Englewood Railway.

Aerial video of the accident scene taken from above Woss, B.C. as rescue workers help to free workers trapped underneath logs 0:33

Derailment began with flawed couplers

The five men were working at the bottom of the railyard hill when 11 rail cars came loose above them on April 20, 2017.

Faulty coupling had allowed the cars, loaded with logs, to detach and roll freely down the track toward the maintenance crew.

The failsafe should have been a derailer, which would have interrupted the cars and pushed them off the tracks.

The train did hit the derailer, but it hadn't been installed properly and its ties were rotted by rain — so the cars overpowered the failsafe and continued as a runaway, picking up speed.

This photo, included in the WorkSafeBC report, shows the state of decay in the ties to which the derailer had been fastened. Both ties were noted to be rotten to the extent that the train easily overpowered the derailer. (WorkSafe B.C.)

They crashed into a railway maintenance car, known as a speeder, and a backhoe. Four men were in the speeder and one more was using the backhoe.

The railcars, speeder and backhoe carried on downhill for another kilometre-and-a-half before they derailed and crashed.

The men were hit by falling logs and pinned underneath. Two of the men in the speeder and the backhoe operator died.

Workers 'made the right decisions'

The northern Vancouver Island community of Woss has about 200 residents. Western Forest Products is one of the area's major employers.

Cinkant, the union safety officer, said it struck him that the workers had done everything right on the day they were killed.

In this image broadcast by CHEK, logs are shown spilled onto the Englewood Railway track in Woss, B.C., following the derailment in April 2017.

The report said they had been working in a different area of the railyard earlier that day, but decided to move when the supervisor noticed the equipment had been flagged for repair.

"They all made the right decisions to do something safe and then this happens," Cinkant said.

Western Forest Products shut down the logging train in the aftermath of the derailment. The Transportation Safety Board also investigated the deaths but has yet to release its report.

With files from On The Island