Handing a win to Texas education officials, an Austin-based federal judge Wednesday dismissed a lawsuit filed by the Houston Independent School District in an effort to stop the state from seizing control of its troubled school board.

The lawsuit was one of the last weapons in the 200,000-student school district’s arsenal to avoid a near-inevitable state takeover in the making for months, prompted by the continued dysfunction of the school board and repeated low performance of one high school.

In a final judgment, U.S. District Judge Lee Yeakel denied the district’s request for a preliminary injunction to stop Texas Education Commissioner Mike Morath from appointing a board of managers to replace the board. He also remanded to state court some of the district’s claims that Morath had exceeded his authority as he moved toward a takeover.

The decision came down just two weeks after the parties argued their cases in front of Yeakel in early December.

Lawyers for the state had argued Morath has multiple, airtight reasons to take over the state’s largest school district, and that the move was necessary to improve educational opportunities for students.

Houston ISD attorneys argued that Morath had no right to replace the school board, a decision they said would disenfranchise voters of color. Houston Federation of Teachers, the local teachers union, fought to join Houston ISD’s case and bolstered the claims of voter disenfranchisement.

Yeakel withdrew his previous order allowing the union to intervene and instead denied it. He said the union should pursue its legal claims separately.

He said the district did not have standing to bring its voting and civil rights actions on behalf of its voters. “The court further concludes that there is not a substantial likelihood of success on the merits for any of Houston ISD’s federal claims,” he wrote.

Houston ISD has one last chance to plead its case directly with the agency this week to avoid a takeover. Morath has indicated he anticipates seating a new board by the spring.