British Transport Police (BTP) had been patrolling Preston station when they were alerted to a man threatening passengers onboard a train.
Officers boarded the service and apprehended the man, who was found in possession of drugs. He was released and told to attend an interview at a police station at a later date.
But instead of leaving the station via the pedestrian exits, the man goaded officers by casually walking across the train tracks whilst shouting abuse at them.
BTP said he became increasingly abusive towards its officers and he was subsequently arrested and taken into custody.
He has since been released under investigation.
A spokesman for BTP said: "A text came into us at Preston about a male who was threatening people on board a service.
"Officers attended the service and male was identified. He was searched and an amount of drugs found.
"The male's details were obtained and he was going to be interviewed at a later date.
"He was let on his way and to officers dismay he then proceeded to walk across the lines from platform one to the depot and back again.
"Apparently he was trying to get to Ribbleton.
"Strange way to do it however he carried on abusing the officers and was then arrested for possession of drugs (the earlier job) and trespass on the railway.
"He has been interviewed and released under investigation whilst enquires continue."
Thanks for reading. If you value what we do and are able to support us, a digital subscription is just £1 per month for the first two months. Try us today by clicking HERE.