A federal court ruled that President Trump’s removals were illegal and arbitrary and ordered two board members reinstated.