A US federal judge invalidated a Trump administration policy that sought to limit the duration of stays for foreign students and journalists. The…