A US judge has cleared the way for the Trump administration to pull thousands of US Agency for International Development workers off the job.