Two strikingly similar tragedies in two very different parts of the country are underscoring the dangers of not being in tune with one's surroundings when walking along train tracks.

Sixteen-year-old Jacob Hicks died Monday night, just hours after he was struck by a train in Oshawa, Ont.

Another teenaged boy, Daniel McPherson, suffered a similar fate in Leduc, south of Edmonton on Monday afternoon, when he was struck and killed by a freight train.

In Ontario, the train's engineer told CTV News that Hicks appeared to be listening to music and was fixated on a handheld electronic device as he traversed the tracks at a level-crossing.

A local bylaw prohibits train crews from using their horns in the area, but the driver of the train told CTV he did blow the whistle in an attempt to get the teen's attention.

The crossing was also equipped with automated lights and bells that were active at the time, but Durham Regional Police said he was wearing headphones that likely prevented him from hearing the warnings.

"If people are able to walk in the area of a train and their music is so loud that they are not able to hear when the arms are going down and the bells are going off, that's problematic," Insp. Dave Saliba told CTV News.

The Grade 11 student was taken to an area hospital before being transferred by air ambulance to Toronto's Sunnybrook hospital where he later died.

Alberta incident

The RCMP believes McPherson was listening to music that drowned out the noise of the approaching train, its squealing brakes and horn when he was struck from behind.

Emergency responders arrived in time to confirm that he had succumbed to his injuries.

According to pedestrian safety guidelines posted on the CN website, children are advised to remove headphones whenever they're near railway tracks.

"Do not count on hearing a whistle to warn that a train is coming," CN warns, noting that pedestrians should only try to cross rail lines at designated crossings.

The U.S.-based rail safety education group Operation Lifesaver advises pedestrians to avoid all manner of electronic distraction including texting, emailing or even phonecalls when near train tracks.

The group warns that modern trains can extend a metre or more beyond the width of the tracks, and may not give the warning you might expect.

"Today's trains are quieter than ever, and an approaching train is always closer and moving faster than you think," the group said in a statement.

A freight train travelling at 80 kilometres per hour can take almost two kilometres to come to a stop.