A federal court has ruled that the Trump administration’s Department of Energy (DOE) funding cap on state energy programs is illegal.