Lewis Ellis, who was 17 at the time of the incident, pleaded guilty to domestic assault, criminal damage and witness intimidation and was sentenced at Leeds Crown Court to two years in a Young Offender Institution.
He was also ordered to pay a victim surcharge of £34 after the court hearing on Tuesday, May 10.
The court heard how Ellis, from Westtown in Dewsbury, was sitting next to the victim, who he knew, on a train to Leeds when he punched her in the head three times, slapped her repeatedly and kneed her on the top of her thigh.
The assault occurred on Sunday, July 11, of last year.
He then bit her hand before taking her phone, which also contained her bank card and provisional driving licence.
Following his arrest, Ellis repeatedly harassed his victim, sending incessant and threatening text messages in an attempt to make her drop charges against him.
Det Sgt Roy Durant, of British Transport Police, said: "This was a nasty and unprovoked attack on a young woman who was left shaken and terrified.
"If you witness any crime on the railway, you can use our discreet text service 61016 to report it to us."