The Supreme Court yesterday upheld the extension of the federal age discrimination law to protect state and local government workers.

The ruling could upset mandatory retirement laws for public employes in more than half the states and in hundreds of U.S. cities. Its greatest immediate impact will be on police and fire departments, which often set mandatory retirement as low as age 55.

The law bars age discrimination against workers until they reach 70. While not explicitly outlawing involuntary retirement of individuals before age 70, it subjects to court challenge any blanket assumptions that all people of a certain age are unfit for a job.

In a 5-to-4 vote, the court held that Congress' 1974 extension of the law's coverage did not unconstitutionally intrude on state and local authority. Justice William J. Brennan Jr., writing for the majority, reversed a U.S. District Court ruling to the contrary.

State and local officials had waged an unusually vigorous battle before the Supreme Court against such a ruling, arguing that it would limit upward mobility for younger employes and even compromise public safety by keeping older firefighters, for example, on the job.

They also said it would be costly: senior employes are paid more and their health insurance costs more.

Beyond that, the decision appeared to dash those officials' hopes--raised by a landmark 1976 Supreme Court ruling--for greater constitutional authority to resist unwanted federal laws affecting the way they run their governments.

"The court decides today that Congress may dictate to the states, and their political subdivisions, detailed standards governing the selection of state employes, including those charged with protecting people and homes from crimes and fires," Chief Justice Warren E. Burger wrote for the dissenters.

Burger was joined by Justices Lewis F. Powell Jr., William H. Rehnquist and Sandra D. O'Connor.

The case, Equal Employment Opportunity Commission vs. Wyoming, arose when Bill Crump, a game division supervisor for the Wyoming Game and Fish Department, complained about being retired involuntarily at age 55. His dismissal was based on a state law giving supervisors in his department the option of dismissing workers of that age and older.

The EEOC sued on Crump's behalf under the federal Age Discrimination in Employment Act. A U.S. District Court, deviating from most lower court rulings on the act, held that its extension to the states was unconstitutional under the 10th Amendment, which reserves to the states unspecified powers "not delegated" to the federal government.

Wyoming said it believed its case paralleled the 1976 ruling (National League of Cities vs. Usery) that struck down Congress' extension of federal wage and hour provisions to state and local governments.

But Brennan, 76, who dissented in the 1976 case, said yesterday that the 1976 decision did not "create a sacred province of state autonomy." The federal intrusion into state affairs was "less serious" in the Wyoming case than in the earlier ruling, he wrote.

"Nothing in this case," Brennan said, "portends anything like the same wide-ranging and profound threat to the structure of State governance."

Brennan said that the act would not necessarily prevent Wyoming from retiring some workers at 55.

"The state may still, at the very least, assess the fitness of its game wardens and dismiss those wardens whom it reasonably finds to be unfit," he said. But it must do so "in a more individualized and careful manner than would otherwise be the case."

In dissent, Burger, 75, said that he did not believe that the act's "largely theoretical benefits to the federal government outweigh the very real dangers that a fire may burn out of control because the firefighters are not physically able to cope; or that a criminal may escape because a law-enforcement officer's reflexes are too slow to react swiftly enough to apprehend an offender; or that an officer may be injured or killed for want of capacity to defend himself."

Locally, the Maryland and Virginia retirement age of 60 for police will be affected. District of Columbia employes already were covered by the federal law.