A federal judge in Texas has ordered the Biden administration to revive a Trump-era border policy that required migrants to stay in Mexico until their US immigration court date.