A federal judge ruled Monday that a nearly complete offshore wind project halted by the administration can resume, dealing President Trump a setback in his ongoing effort to restrict the industry.