Police were called to a Burnley railway station following reports of two drunken men on the tracks, a court has heard.
Blackburn Magistrates' Court was told how one of the men was alleged to have "flashed" at two women waiting for their train during the incident on October 23, 2022.
Zak Jon Greenwood, 32, of Cleggswood Avenue, Littleborough, was convicted in his absence of being drunk and disorderly at Burnley Manchester Road Station and trespassing on the railway lines.
He was fined £660 with £100 costs and £264 victim surcharge.
James Hudson, prosecuting, said when British Transport Police officers arrived Greenwood was aggressive from the outset, saying the other man, who had been arrested for the exposure offence, had done nothing wrong.
"He was shouting and swearing loudly and there was a spirits bottle hanging out of his pocket," said Mr Hudson.
"Members of the public were shocked by his behaviour."
On his way to the police station Greenwood was banging his head against the cage of the police van and shouting abuse towards the officers.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here