Court rejects government's energy "emergency" that kept coal plant open