A federal judge in Boston invalidated Trump administration regulations that sought to limit the stay duration for foreign students, researchers, and…