A federal judge blocked Trump administration policies that had stalled solar and wind projects, giving renewable energy developers a major win.