A divided Supreme Court yesterday reversed itself on a major states' rights issue and ruled 5 to 4 that Congress has broad power to impose its will on state and local governments, even in areas that traditionally have been left to their discretion.

The court also held that the congressional power is not subject to judicial review.

The opinion by Justice Harry A. Blackmun came in a San Antonio case on whether overtime provisions in federal labor law apply to municipal transit workers. The city said it should be exempt; labor unions and the Reagan administration said it should not.

The court, in taking the unions' side, expressly reversed a decision it made on the same wage-and-hour issue nine years ago. That opinion, written by Justice William H. Rehnquist for a court also divided 5 to 4, held that the 10th Amendment bars Congress from legislating in areas that have been the "traditional governmental functions" of the states. It was hailed as a possible reversal of the trend toward increasing federal power since the New Deal.

Blackmun, who voted with Rehnquist in 1976, was the justice who yesterday tipped the balance back the other way.

Joined by the dissenters in the 1976 case -- Justices William J. Brennan Jr., Thurgood Marshall, Byron R. White and John Paul Stevens -- Blackmun said he had decided that the "political process ensures that laws that unduly burden the states will not be promulgated," and that it should not be up to an "unelected" judiciary to preserve state powers.

The reversal drew a harsh dissent from Justice Lewis F. Powell Jr., who said the majority decision "substantially alters the federal system embodied in the Constitution," and could lead to an "emasculation of the powers of the states."

Powell, joined by Rehnquist and Chief Justice Warren E. Burger and Justice Sandra Day O'Connor, said that "despite some genuflecting . . . to the concept of federalism, today's decision effectively reduces the 10th Amendment to meaningless rhetoric."

The 10th Amendment reserves to the states all powers not expressly granted by the Constitution to the federal government.

The Reagan administration, while asking the court to uphold federal wage-and-hour law in the San Antonio case, also had urged that the 1976 decision not be overturned.

"Those of us who feel strongly about states' rights . . . can only hope that Congress will take very seriously what is implicit in this opinion -- that the bulwark of protection for state interests has shifted to Congress itself," Solicitor General Rex E. Lee said yesterday.

Officials of organized labor, who had been jolted by the 1976 ruling, were elated yesterday.

The decision, in a case called Garcia v. San Antonio Metropolitan Transit Authority, "opens the way for federal protective legislation in a number of areas," Gerald McEntee, president of the American Federation of State, County and Municipal Employes, said. "A major piece of what made us second-class citizens has now been revoked," he said, and "federal standards can be set for all workers now, including state and local government employes."

AFL-CIO associate general counsel David M. Silberman said the decision "represents a return to a sensible and balanced view of the relationship between the states and the federal government."

But Alan Beals, executive director of the National League of Cities, said the decision was "nothing less than a surrender document -- for the states, the cities and even the court itself."

In a prepared statement, Beals said the "court has decided to let the political winds that blow across Capitol Hill and the Federal Triangle dictate the extent to which state and local governments can make any decision about their own activities.

"The court has clearly upset any semblance of balance between the interests of federal policy and our once-proud traditions of local self-government," Beals continued. "We believe that the Supreme Court has abandoned one of its most vital responsibilities as the protector of our Constitution."

The Constitution gives the federal government broad power to regulate "commerce among the states." That power has been used to pass major social legislation ever since the New Deal of the '30s. The 1976 case seemed to reverse that trend so far as the "traditional . . . functions" of state and local government were concerned.

But Blackmun yesterday said the court had been unable in various cases since 1976 to define precisely what it meant by "traditional governmental functions" of the states deserving of protection.

That inability, Blackmun said, convinced him that the 1976 standard was "not only unworkable but is inconsistent with established principles of federalism and, indeed, with those very federalism principles on which National League of Cities the earlier case purported to rest."

Nine years ago, he said, the majority was concerned about diminishing state and local government powers and "underestimated" the ability of the national political process to protect their interests. "The court tried to repair what did not need repair," Blackmun said.

Powell, in his dissent, criticized Blackmun not only on substantive grounds but also for violating the court's rule against reversing its recent decisions. "The stability of judicial decision, and with it respect for the authority of this court, are not served by the precipitous overruling of multiple precedents that we witness in this case," he said.

Powell said it was irrelevant whether the political process protected states' interests. "The states' role in our system of government is a matter of constitutional law, not of legislative grace."

O'Connor, in a separate dissent, said that "all that stands between the remaining essentials of state sovereignty and Congress is the latter's underdeveloped capacity for self-restraint. The court today surveys the battle scene of federalism and sounds a retreat. Like Justice Powell, I would prefer to hold the field and, at the very least, render a little aid to the wounded."

Rehnquist issued a separate one-paragraph dissent. He said he did not "think it incumbent on those of us in dissent to spell out further the fine points of a principle that will, I am confident, in time again command the support of a majority of this court."