President Trump’s secretary of state and national security adviser said he intended to stick with the administration to the end.