Ian Bryson, a lawyer representing both women, said his clients were surprised and glad that the commissioner had stepped down. His departure came one day after the women filed an amended complaint in their lawsuit, which lists the commissioner, the city and 10 other current and former members of the department as defendants.

Mr. Bryson said his clients were “Philadelphia’s best and brightest, and they were placed in very unfavorable jobs as a result of making their reports and complaints.”

Mr. Bryson said that Corporal McCowan, who is black, and Officer Allen, who is black and Hispanic, hoped the resignation would allow other women of color to have their voices heard.

“They’re not only representing themselves, but workers at large, and they’re happy to see that they’re being heard,” he said.

Mr. Kenney said the Police Department had not acted quickly enough after the city put sexual harassment reforms into place last summer after an internal audit found that the city’s policies for investigating sexual harassment were confusing and deficient.

“While rolling out a new policy understandably takes time,” Mr. Kenney said, “I do not believe the Police Department has taken the necessary actions to address the underlying cultural issues that too often negatively impact women — especially women of color.”

Officer Allen said in the complaint that a direct supervisor had twice grabbed parts of her body against her will in 2012 while they were working together and that another officer had inappropriately grabbed her on his last day of work in 2016. She also said someone had tampered with a bottle of breast milk she kept in a refrigerator at work for her son. Corporal McCowan said an officer tried to pull a wedding band from her finger in January.