A California federal judge on Thursday ordered six US agencies to reinstate thousands of recently-hired employees who were fired as part of President Donald Trump's purge of the federal workforce.