Another engine from Kayamkulam was brought, after which the train left for its onward journey, railway sources said.
Rail traffic was affected for at least two hours following which some trains were held up in stations.
Police said four railway workers were working with the rail-road drilling machine on the track when they saw the train and managed to move away.
But they could not remove the machine.
Disclaimer: No Business Standard Journalist was involved in creation of this content