The identity of the deceased, who seems to be in his mid-30s, is yet to be known, they said.
GRP Inspector Puran Singh Chauhan said prima facie it seemed the man had committed suicide by tying one end of a rope to the window's grill and the other around his neck.
Since the train reached the junction around 4 am in the morning, nobody saw him, he added.
Police said the man was not carrying a train ticket and therefore, his identity could not be immediately known.