In his Senate confirmation hearing for secretary of state, Exxon’s former chief differs with Donald Trump on keeping the country in the international accord.