Two U.S. soldiers died after they were hit by a train in southwestern Germany, police said Sunday.

The two women, aged 21 and 22, started walking across the tracks at Neckarsteinach station, east of Heidelberg, as a train was approaching late Saturday evening, regional police said in a statement.

The train driver sounded a warning signal and braked, but was unable to avoid a collision. The younger woman was killed immediately and her companion died on the way to a hospital.

Police said the women had been at a party nearby and apparently were trying to get to a car park near the station.

The U.S. military said the two soldiers belonged to the Army's 5th Corps, headquartered in Heidelberg.

The victims' names were being withheld pending notification of next of kin, 5th Corps said in a statement. It added that German and U.S. authorities were investigating the incident.