A federal judge has ruled that the head of a federal watchdog agency must remain in his job, saying President Donald Trump’s bid to remove the special counsel was unlawful.