A federal judge froze the Department of Homeland Security’s policy barring members of Congress from conducting surprise oversight visits to Immigration and Customs Enforcement facilities, a ruling that was immediately appealed by the Justice Department.