A fourth youth managed to jump to safety before the accident in Panipat city, a police officer told AFP on Wednesday.
“The victims were busy taking selfies and when they saw a train approaching they jumped to a second track without realising another train was coming on that [line],” MS Dabas told AFP.
“One of them saved his life as he jumped on the other side of the track.”
The group had come to Panipat to attend a wedding. Two of those killed were 19 years old and the third was 18.
Experts warn that youngsters obsessed with social media are going to extreme lengths to post selfies seen as daring and risky.
A study last year by the All Indian Institute of Medical Sciences said 259 people globally had died while taking selfies between 2011 and 2017.
The highest number of incidents were reported in India, followed by Russia, United States and Pakistan.
In 2017, three students were killed on a railway track in Karnataka state, while a man died in Odisha after an elephant wrapped its trunk around him and crushed him to death as he tried to take a selfie with the animal.