Yellow and green cab medallions are not “a shield against the rapid technological advances of the modern world,” a Queens judge declared as he dismissed lawsuits by taxi companies that claimed Uber operates illegally.

A coalition of cab companies and credit unions that finance costly medallions argued that only yellow or green cabs can pick up street hails under the law.

But Queens Judge Allan Weiss wrote in a decision released on Wednesday that the idea that the medallions would protect the struggling industry against app-based car services was unreasonable.

“In this day and age, even with public utilities, investors must always be wary of new forms of competition arising from technological developments,” Weiss wrote in a 13-page ruling against Glyca Transportation and other medallion companies.

“Passenger communications to Uber-type companies via a smartphone are not street hails, which are requests made by passengers standing on the street who gesture or make an utterance.”

Taxi & Limousine Commission chief Meera Joshi hailed the ruling.

“This decision is a victory for the riding public and leaves no question as to the appropriateness of our regulatory approach to app-dispatched services,” Joshi said in a statement.

“Passengers will remain free to continue to enjoy the many transportation options available to them, whether new, more traditional, or both.”

The ruling was another setback for the battered yellow-taxi industry in the face of increasing competition. At an earlier hearing, lawyers argued that the value of a once-coveted Big Apple taxi medallion had dropped 40 percent.

Taxi-industry advocates will appeal the ruling.

“An e-hail is a hail, and no amount of distortion, misdirection or mischief will change that,” said Todd Higgins, the lawyer representing the coalition of taxi companies and credit unions.

“In the meantime, however, a catastrophe is unfolding, as an entire industry continues to be illegally destroyed,” he said.