A federal judge in Chicago ruled this week that a lawsuit brought by female Ford employees over sexual misconduct at two Chicago plants cannot proceed as a class-action suit.

The ruling was a setback for the plaintiffs, who said they had endured groping, vulgarities and sexual violence despite the company’s efforts to change a longstanding culture of harassment.

The lawsuit, filed in 2014 by more than 30 women, accuses the company of not doing enough to ensure a safe and equitable work environment. It sought to include all women who worked at Ford’s assembly or stamping plants in Chicago from 2012 to the present.

But Judge Robert M. Dow Jr., of the Northern District of Illinois, ruled that the women’s experiences were too disparate to be considered as a single class. The plaintiffs can still sue as individuals.