A federal appeals court on Tuesday reinstated a Democrat who was fired by President Trump from the Federal Trade Commission earlier this year, dealing a blow to Mr. Trump’s monthslong attempt to permanently remove her from the consumer protection and antitrust enforcement agency.