The Trump administration can’t end billions in grants for climate-friendly projects, a judge says