The fate of BNSF Railway Co.’s new terminal near the Port of Los Angeles is now in jeopardy even though it has been in development for 10 years at a cost of more than $50 million and would provide badly needed rail capacity.

In March, a judge halted the railroad’s plans, ruling its environmental review wasn’t properly done. Opponents of the project, which include nearby businesses, neighbors, air-quality regulators and the City of Long Beach, had dug in their heels over the expected increase in truck traffic, pollution and...