No judge has any say whatsoever in foreign matters, those are the powers of the POTUS. He can enter or remove any such contracts dealing with foreign entities, and any illegal alien is a foreign entity. It is about domain authorities. Judges are only domestic and only for citizens of the US.