Exxon Mobil Corp. and Chevron Corp. posted stronger-than-expected earnings for the first quarter as higher oil and natural gas prices outweighed production outages from the Iran war.