IN 2009, when Metrorail ridership peaked at about 225 million annual passenger trips, no one — not at the transit agency, nor in academia, nor in the industry, nor any fortuneteller — could have predicted the scope of safety mishaps and ridership declines that ensued, costing the subway system more than 15 percent of its passengers. Now a federal judge, in a specious ruling, blames federal and state transit officials for not taking a “hard look” into the crystal ball today to divine Metro’s ridership levels a decade or two from now. And, says the judge, this failure is so glaring that it justifies blocking progress on one of the most critical transit undertakings in the region — the Purple Line light-rail project, which would draw about a quarter of its riders from Metro while linking close-in Maryland suburban neighborhoods.

U.S. District Judge Richard J. Leon’s opinion — shot through with illogic and heedless of precedent — is an excellent candidate for reversal on appeal. Unfortunately, as the judge surely understood, that may not come soon enough to save the Purple Line, whose future is threatened owing to his decision.

The judge swallowed spurious arguments from Purple Line opponents, who said Metro’s ridership travails should require Maryland and federal officials to redo their environmental study of the Purple Line, as if adjusting the light-rail project’s passenger projections by 3 or 6 or even 13 percent would trigger an entirely new footprint or design — which it wouldn’t. In fact, even if Metro disappeared, thereby depriving the Purple Line of a quarter of its riders, the Purple Line would still be one of the most heavily used light-rail projects to win federal funding nationally in recent years.

Nonetheless, by ordering a new environmental assessment, Mr. Leon has ensured a delay, meaning spiraling costs, and further jeopardized nearly $1 billion in federal funding, originally to be released last summer before the judge intervened. Without that funding, the Purple Line is dead. Fortunately, a Trump administration budget document released Wednesday appeared to leave room for the funding to go forward if legal obstacles are removed.

Mr. Leon’s jumbled, inside-out ratonale cavalierly ignores the judgment of federal transit experts, which the Supreme Court has specifically warned judges not to do in cases involving environmental studies. He says federal officials were “arbitrary and capricious” for not producing a point-by-point rebuttal of declarations by Purple Line opponents who predict Metro’s ridership is unlikely to recover far into the future. In fact, federal experts quite reasonably offered five scenarios for future Metro (and Purple Line) ridership, from moderately bright to implausibly grim. Under every scenario, the officials said, the Purple Line’s footprint and environmental impact would be unchanged, and it would fulfill its main purpose: transporting tens of thousands of riders daily.

The judge is distressed that transit officials do not possess oracular powers of clairvoyance — that they did not forecast which scenario is “actually most likely to occur.” His reasoning would be laughable if not for the consequences, which could deny tens of thousands of commuters a convenience that would improve their lives and dozens of aging communities the chance for economic revitalization.