Three teenage girls allegedly bashed two women on a train in inner Brisbane before punching a police officer in the head and spitting on her.

The three girls, aged 14, 15 and 17, were on a city bound train about 5pm (AEST) on Monday when they allegedly attacked two women.

The train was stopped at Dutton Park station where the two women got off with bruises and abrasions.

Two senior officers then boarded the train, and the girls allegedly attacked them.

One officer was allegedly spat on and punched in the head before the girls were arrested.

The 15 and 17-year-old girls were charged with two counts of assault occasioning bodily harm, two counts of obstructing police and one count of seriously assaulting a police officer.

The 14-year-old girl was charged with two counts of assault occasioning bodily harm and two counts of obstructing police.

The 17-year-old is due to appear before Brisbane Magistrates Court on Tuesday.

The 15 and 14-year-olds will be dealt with under the Youth Justice Act.