Three locomotive engineers were killed and dozens of passengers were injured when a Via Rail train derailed in Burlington, Ont. Sunday afternoon.

Among those killed was an engineer in training, Via Rail officials said. More than 40 passengers were treated on scene or taken to area hospitals with various injuries, many of them minor. Three people had to be airlifted to Toronto and London with serious injuries.

The derailment occurred around 3:30 p.m. in an industrial area near Aldershot station, about 60 kilometres west of Toronto. One of the six derailed train cars crashed into a small building near the train tracks, flipping on its side.

Via train 92 was travelling eastbound from Niagara Falls to Toronto with 75 passengers and four crew members on board.

About 60 passengers were initially trapped in the wreckage, as dozens of police officers, firefighters and paramedics worked frantically to free them. Some were carried away on stretchers while others walked away shaken, but unharmed.

Witnesses described a chaotic scene resembling a "war zone" as passengers scrambled to get to safety.

By 6:30 p.m., everyone was out of the train and all passengers had received some type of medical attention, Via Rail spokesperson Michelle Lamarche said.

She did not disclose any information about the dead engineers who were riding in the locomotive at the time of the crash. One crew member survived and was taken to a nearby hospital with unknown injuries.

Halton Regional Police Chief Gary Crowell said the bodies of all three Via employees were pulled from the mangled train by 8 p.m. Their next of kin are being notified, he said late Sunday.

"It's very tragic," Via Rail Chief Operating Officer John Marginson told reporters. "We are a small company…and we know everyone by name."

Some passengers who emerged from the crash unscathed told reporters they were trying to hang on to anything in sight as the train jumped off the tracks, causing people to fall on top of each other.

Among the youngest passengers on the train was 10-year-old Drew Carmichael, whose left leg was broken in the crash.

"I was panicking. I was scared," he told CTV News at a Hamilton hospital. "I keep thinking about how lucky I am that I'm not dead."

It was Drew's first time aboard a Via Rail train.

"Everyone kept screaming," passenger Deanna Vilella told CTV News. "It was just chaos.

"It was like a plane crash. People were flying, luggage was flying."

Marginson said one person suffered a heart attack during the crash.

For a while, Hamilton General Hospital was operating under code orange, which signals an external disaster.

About 30 passengers were well enough to leave the scene on their own and board a bus to Toronto's Union Station.

Lamarche said anyone seeking information about passengers on board Via train 92 should call 1-888-842-6141.

It was not immediately clear what caused the derailment and Marginson said it's "premature" to speculate. It was dry and sunny in the area at the time.

The Transportation Safety Board of Canada is sending a team of investigators to Burlington to pinpoint the cause of the disaster.

The train was equipped with a recording device, which should assist the investigation. TSB spokesperson Chris Krepski said some locomotives also have video cameras, although it's not clear if this one did.

There are now separate investigations underway by the TSB, Via Rail, the Canadian National Railway and police.

Krepski said a full investigation by the Transportation Safety Board could take a year.

Marginson said crews are now trying to move the damaged train cars and debris off the train tracks so that investigators can examine them.

"Night has fallen upon us here, so the investigation is going to take some time," he said.

He said injured passengers are Via's first priority and the company has sent some staff to various hospitals to assist them, if necessary.

There were no concerns about a fuel leak from the locomotive, Marginson added.

"The people who take charge at these scenes have done an excellent job. All the right people are there," he said.

Highway 403 was shut down in the area and GO Transit says its commuter trains are turning back at Burlington.

GO is advising passengers that delays are expected on the Lakeshore West rail line during Monday morning's rush hour.

Train service updates will be posted at www.gotransit.com and www.viarail.ca

With reports from CTV's Omar Sachedina and John Vennavally-Rao