The youth allegedly tried to molest the girl while she was crossing the railway tracks in the afternoon, a senior Railway Police official said.
Some locals at the BG Yard locality noticed the incident. They caught hold of the accused and assaulted him before handing him over to the Railway police.
However, the accused denied the charge saying he had tried to stop the girl from crossing the tracks as a train was approaching.
The girl, who stays in a nearby area, has been sent for medical check-up.
Railway police were interrogating the accused.