When Michigan shocked the nation and passed its right-to-work law three years ago, there was no question that Big Labor wouldn’t take it lying down. The tentacles of Big Labor run deep in the state, not only in the obvious automotive-related businesses but also in the state employees organized under the United Auto Workers (UAW) banner. It was on behalf of those workers, who fall under the auspices of the state’s Civil Service Commission, that the UAW filed suit to maintain its hold on the agency fees it has routinely extracted from these workers.

But the move backfired. The Michigan Supreme Court upheld the 2012 right-to-work law even for public-sector employees. The 4-3 decision fell mainly along party lines — five of the seven members of the court are Republicans, and the two Democrats were among the dissenting trio.

The court found, “Although the [Civil Service] Commission had authority over civil service employees’ rates of compensation, conditions of employment, and grievance procedures under [the state Constitution], the Commission’s power to regulate the conditions of employment through public collective bargaining agreements did not encompass the specific authority to tax or appropriate, which generally rested exclusively with the Legislature unless the Constitution affirmatively provided that power to another constitutional body.”

About 36,000 workers are affected by the decision, along with millions of dollars that will stay in the workers’ wallets rather than fattening the coffers of Big Labor. If the trend from other states adopting similar right-to-work provisions holds true, as many as 20,000 of those workers could walk away from the union.

It could also set a precedent for a class-action suit. Patrick Wright, the vice president of legal affairs for Michigan’s Mackinac Center, stated, “The majority correctly noted that state employees unions have illegally been receiving agency fees from state employees for decades.” He added, “Agency fees for state employees have been illegal since the adoption of the 1963 Constitution.” Yet for nearly 50 years the UAW and other unions were basically unchallenged.

In most states, this likely would have been a slam-dunk for worker freedom, but we’re talking about Michigan here. The close decision against the UAW was a bit surprising, and given the cash involved it’s certain the unions will be loaded for bear once the judges who ruled against them come up again on the ballot. (Nor are they likely to give any quarter to the Republican who ruled in their favor.)

Michigan isn’t the only state facing problems with unions. Underfunded pensions are crushing many states. Some experts estimate the liabilities to be somewhere between $1 trillion and $4 trillion.

And despite the legal slap to organized labor in Michigan, their New Jersey counterparts are trying to get their pension shortfalls addressed by Garden State jurists. Facing a budget crunch last year, Gov. Chris Christie backed away from a promise to fully fund the state’s pension fund, and the public sector unions are demanding over $3 billion to fix it. This despite the plain language of the state constitution that prohibits taking on debts of more than 1% of the state’s budget.

The ruse is simple, though. As a Public Employees Retirement System spokesperson said, “We want a judgment answered so we are to the front of the line getting our money before anyone else gets it, because it is our money.” And that’s the way it is to Big Labor. Just ask a former GM or Chrysler bondholder or non-union pensioner how their place in the creditor line worked out for them.

But we’ll take a win where we can get one, and the story out of Michigan is a good step in the right direction.