The ruling is a setback to President Trump and Kari Lake, a Trump ally who has led efforts to shutter federally funded news networks.