Magistrates voted unanimously on Wednesday to overturn an appellate court's ruling in favor of the Mexican Union of Electricians, or SME.
The workers launched a legal battle in October 2009 after then President Felipe Calderon order the dissolution of the state-run Luz Y Fuerza power company.
The union protested Calderon's decision with hunger strikes, marches and lawsuits.
The government said it ordered the company's dissolution because its spending was increasingly outpacing sales.
The company supplied 25 million consumers in Mexico City and the surrounding area. The Federal Electricity Commission, the state-run utility that provides electricity across the rest of the country, took over those customers.