Mr. Trump wrote on Twitter that he had helped keep a plant in Kentucky. Although Ford had planned to move some work to Mexico, it had intended to keep the factory open.