Magistrate Jai Chand Pandey says the accident occurred early Friday when the victims were returning home after attending a party near Gorakhpur, a city 740 kilometers (460 miles) east of New Delhi.
Pandey said the three injured were hospitalized, one of them in serious condition.
Railway accidents are common in India, which has one of the world’s largest train networks serving 20 million passengers a day.
There are hundreds of unmanned crossings across the country. Poor finances limit efforts by rail authorities to man the dangerous crossings around the clock.