The incident occurred at around 11.50am in the village of Noiraigue, west of Neuchâtel, cantonal police said in a press release.
The victim, a resident of the canton of Vaud, was cycling east along the railway tracks from the Noiraigue train station, according to the statement.
He decided to turn at the level crossing in the middle of the village where the safety barriers were lowered before he was struck by the train linking the community of Buttes to Neuchâtel, which had just left the Noiraigue train station, the release said.
Following the impact, the victim died on the spot, police said.
Twenty passengers on the train were transferred to a bus and train service on the regional line was disrupted for almost four hours.
Passenger service on the line is operated by Swiss Federal Railways (CFF) in collaboration with the Neuchâtel regional transport authority (transN).
The local prosecutor has opened an investigation to determine the exact causes of the accident.