Twelve current and former Metra police officers are suing the railroad in federal court, accusing high-ranking officials of racism and discriminatory behavior.

The officers, who are all black, said supervisors falsely blamed them for petty infractions, forced them to perform tasks white police were not asked to do and refused to let their attorneys attend disciplinary hearings.

“There’s a problem at Metra,” attorney Jill Willis said Wednesday. “These people were railroaded out of a job.”

Metra leaders “vehemently” denied the allegations of racism and discrimination, spokesman Michael Gillis said.

“This lawsuit from current and former police officers, most of whom were justifiably disciplined for dishonesty or negligence in the performance of their duties, has absolutely no merit. We will relentlessly contest these allegations in a court of law and are confident we will prevail,” Gillis added.

In the lawsuit, officers complain of derogatory comments by one white commander that the special operations unit should be named “Black Ops,” referring to African Americans. One officer stated he was disciplined for losing a flash light in a scuffle with a disruptive passenger who was under the influence of drugs. Another described being written up for not wearing the required hat, although the headgear was not available.

The charges come as the Metra police department enters its third year of a rebuilding after a scathing 2014 report that found mismanagement and outdated practices on the force. As part of the reforms, Metra hired as its chief Illinois State Police veteran Joseph Perez.

However, the lawsuit filed last week blames Perez for some of the problems and says Metra violated the Civil Rights Act.

Gillis said the personal attacks against Perez could be defamatory.