A judge ordered the reinstatement of thousands of dismissed probationary employees from the departments of Veterans Affairs, Agriculture, Treasury, Energy and the Interior.