Some visitors to the US left stranded by the immigration crackdown by President Donald Trump have been allowed to stay after a federal judge's temporary ruling.