Judge orders some federal agencies to reinstate thousands of probationary workers