The country’s emergence as an unlikely mediator between the U.S. and the Islamic Republic illustrates how diplomacy has become more personal and transactional under President Donald Trump.