A federal judge criticised the Trump government for attempting to infringe upon foreign students' rights to free speech.