The railway line passes through the reserve forest area.
The adult male elephant came from the forest and broke the gate of the railway level crossing.
The elephant stayed in the area for around 15 minutes then returned to the forest, the officials said.