A US federal judge invalidated Department of Homeland Security regulations that sought to limit visa stays for international students and…