Relatives of Americans imprisoned in Iran implored the Trump administration on Wednesday not to forget their loved ones, whose fates may have just become murkier now that the United States has quit the nuclear accord.

Their angst was further complicated by word that three Americans incarcerated by North Korea had been freed. While happy over that news, some worried that President Trump’s decision to abandon the nuclear agreement would antagonize the Iranian authorities, dimming any prospects of prisoner releases in Iran anytime soon.

Mr. Trump’s success at securing the freedom of North Korea’s prisoners, and failure so far to do the same in Iran, underscored the complexities of the estranged American relations with the two countries, which have vexed successive White House administrations for decades.

At least five American citizens — four of them dual citizens of the United States and Iran — are known to be incarcerated in Iranian prisons.