The ruling is the latest blow to the U.S. Department of Homeland Security’s monthslong effort to slow congressional oversight of the facilities.