The workers, who operate the Roslagsbanan line north of the Swedish capital Stockholm, have been wearing skirts to work for the past two weeks to keep cool in the hot weather.
Employer Arriva banned the drivers from wearing shorts after taking over the running of the line in January, BBC News reported.
While the company has an objection to male employees wearing shorts, it has no problem with them coming to work in skirts.
"To tell them to do something else would be discrimination," he said.
More From This Section
Driver Martin Akersten told the BBC that he and his colleagues came up with the idea to wear skirts after they were informed of the new company dress code in the winter.
"We have always said that when summer comes, we will get some skirts and wear them. It's very warm weather here so we would like to wear shorts but if we can't then we have skirts for comfort," Akersten said.