Glasgow Sheriff Court heard Jefferson Thiruchelvam was spotted by a rail worker at Glasgow Central Station at 11.45pm on January 10, 2022.
He passed through the barrier while tailgating another passenger, and a ScotRail worker went up to him and asked if he had a ticket.
Instead of replying, Thiruchelvam walked away and told the employee not to talk to him.
The 24-year-old then lounged at the staff member and punched him in the back of his head.
British Transport Police (BTP) were called, they came and tried to speak with Thiruchelvam but he was aggressive, clenching his fists in front of him.
Cops took hold of him as he was shouting and swearing: “F*****g get off me, f**k you”.
Thiruchelvam was arrested and taken to Govan police station where he was cautioned and charged.
READ NEXT: Man threw stones at neighbour’s BMW and threatened ‘to do him in’
He appeared at Glasgow Sheriff Court on Wednesday after he pleaded guilty to behaving in a threatening manner and three charges of assault.
He also admitted to failing to appear before the court twice.
In court papers, Thiruchelvam’s address is listed as a Kelvindale property, however, his solicitor told the court he is homeless.
The lawyer added: “My instructions [from him] are to ask for a custodial sentence.
“Prison will give him food, stability, and assistance in finding accommodation when he leaves.
“He was arrested and spent two nights in prison.
“He appears before this court as a first offender.
“There hasn’t been much engagement [with the social worker’s report] but that is due to his homeless lifestyle. He doesn’t have a mobile phone.
“Hopefully, he can get support. He apologises to the police officers.”
Thiruchelvam was sentenced to 108 days in prison by Sheriff Collette Gallagher.