Sharon Levine, a lawyer who helped lay out the unions’ case before Judge Rhodes, warned that his decision would “be a road map for governors across the country to use Chapter 9 to create a self-created emergency.”

Fiscal hawks argue that states and cities already have a pension emergency, just not an easy one to see. Economist after economist has begun to argue in recent years that trillions of dollars are missing from state and local pension systems, but the shortfall is obscured by murky accounting. Governmental accounting rules, in turn, were written differently from corporate ones on the thinking that a city differs from a company. One big difference is that companies go bankrupt by the thousands but cities are thought to last forever, supposedly giving them infinite time and little reason to disclose pension values precisely.

Detroit illustrates the flaw in that thinking, but not just since Tuesday’s ruling. Its painful decline has been happening for decades. As city workers continued to build up their benefits over the years, the cost of the pension promises grew beyond the means of the city’s shrinking tax base. In 2005, the city needed more cash for its pension funds, so it tapped the municipal bond markets for $1.4 billion.

Detroit, by that time, had already reached its legal borrowing limit, but its financial advisers were able to structure the deal to make it appear as if it did not add to the city’s debt. The unions signed on because the mayor at the time, Kwame M. Kilpatrick, warned that the only other option was to lay off 2,000 workers, many of them union members. The prospectus’s description of the constitutional pension protection made it seem as if the city was simply complying with its mandate.

Those securities were the first to go into default as Detroit plunged toward bankruptcy last summer. The investors who bought them have discovered that they, too, are unsecured creditors in bankruptcy — and they, too, thought they had legal protections from the state. “No one should be surprised,” said Richard Ravitch, the former lieutenant governor of New York who is conducting a research project to track the sustainability of state finances. “Every incentive in this system is to kick the can, and everybody’s doing it.”

“The unions knew the contracts would be abrogated in bankruptcy,” he said. “The bankers, too.”

Mr. Ravitch recalled the way company pensions were handled in Chapter 11 bankruptcy cases. In those cases, workers and retirees are treated as secured creditors to the extent that there is money in the pension fund. That money serves as collateral, fully backing the benefits. In the typical company bankruptcy these days, however, the pension fund has a shortfall, and the workers’ claim for that amount is treated as unsecured credit, as Judge Rhodes has ruled for Detroit.

Workers for companies owe their relative protection to big unions, like the United Auto Workers and the United Steelworkers, which pushed for a landmark pension law enacted in 1974. It set up a federal pension insurance program and required companies that promised pensions to fund them. It also empowers the federal government to penalize companies that fail to fund their benefits.