A federal judge in San Francisco wrote Tuesday that “it is now clear” that Lyft drivers should be employees under California’s new gig-work law, but said they couldn’t win their claims in his court because their lawsuit was flawed.

U.S. District Judge Vince Chhabria denied the drivers’ quest for an emergency injunction reclassifying them as employees, struck down their attempt to be a class action and granted Lyft’s motion to compel the individual claims to arbitration. But he left open a way for the case to continue, by seeking to be considered a matter of public interest.

Drivers for Uber and Lyft sued last month, asking to be reclassified as employees immediately so they could receive sick leave during the coronavirus pandemic. Both cases were spearheaded by Shannon Liss-Riordan, a Boston attorney who has filed numerous cases against gig companies, seeking employee status for their workers, starting years before AB5, California’s gig-work law, took effect in January.

The new law makes it much harder for companies to claim that workers are independent contractors, which is how Lyft, Uber and many other on-demand companies classify their workforces.

Although the judge decried her lawsuit as “riddled with defects” and “filed hurriedly in an attempt to capitalize on the current coronavirus pandemic,” Liss-Riordan said she was pleased.

“A court has now stated definitively that Lyft and by implication other gig companies are misclassifying their drivers and violating California law,” she said.

Lyft said in a statement that it appreciated the judge’s recognition that becoming employees could jeopardize drivers’ eligibility for emergency benefits under federal stimulus packages.

“While we disagree with the judge’s comments regarding the merits of the underlying issue as to whether drivers on the Lyft platform are properly classified as independent contractors, we appreciate the judge’s recognition of the fatal flaws in the plaintiffs’ case for an emergency injunction,” it said.

Indeed, Chhabria was scathing about Lyft’s position.

“Rather than comply with a clear legal obligation, companies like Lyft are thumbing their noses at the California legislature, not to mention the public officials who have primary responsibility for enforcing AB5,” he wrote. Lyft’s argument that drivers perform work not within its usual course of business is “frivolous,” he wrote.

Most Lyft drivers agree to mandatory arbitration for disputes when they start working. The case sought to sidestep this by claiming that the drivers’ status needed public injunctive relief because the issues of compliance with AB5 and of sick pay during the pandemic were of public interest. The judge remanded that question to state court.

Chhabria wrote that the case’s argument seeking immediate reclassification so drivers could get sick pay was not compelling. California sick pay is only three days a year and most Lyft drivers, who work part-time, would not qualify for even that amount, he wrote. About 41% don’t work enough to receive any sick pay if they were employees, and of those who qualify, most would get just four hours a year, the decision said.

In fact, the decision said, the Lyft drivers will receive more substantial benefits — sick pay, forgivable loans and unemployment — under federal coronavirus aid packages by remaining independent contractors.

On the same day as the decision, San Francisco and San Jose approved emergency paid sick-leave ordinances for workers within city limits. They apply to gig companies such as Uber and Lyft, as well as those with more than 500 employees. Oakland is expected to follow suit.

The judge chastised the lawsuit’s “tone-deafness,” noting that a plaintiff insists that he will give rides even if he’s sick unless he’s an employee — even though he says he makes only a few dollars a week because business has fallen so sharply.

In the Uber case, U.S. District Judge Edward Chen last week ordered both sides to work together on a way to improve Uber’s sick-pay policy.

Both Uber and Lyft now offer two weeks’ pay to drivers who are diagnosed with COVID-19 or required to quarantine by a medical professional, but the lawsuits state that those requirements are onerous because testing is difficult to arrange.

Lyft and Uber, along with DoorDash, Postmates and Instacart, are pursuing a $110 million ballot initiative, asking California voters in November to exempt them from AB5. The measure seeks to classify their drivers and couriers as independent contractors who would be entitled to some pay guarantees and some benefits.

Carolyn Said is a San Francisco Chronicle staff writer. Email: csaid@sfchronicle.com Twitter: @csaid