Judge halts mass firings of federal workers at some agencies