Ahmadinejad is not Iran's supreme leader. He is second in command to Ali Khamenei. That is the man we have to worry about. Ahmadinejad answers to Ali Khamenei. Iran has secular aspects to its political organization but the religious people still have final word.
Actually, Ahmadinejad is currently third in rank. Hashemi Rafsanjani was elected to a power position close to Khamenei a few months ago, and is second HNIC.
The ayatollah's are also fed up with Ahmadinejad.
Word is, that the ayatollah's ordered the release of the british sailors, and in order to not be humiliated, Ahmadinejad handled it all, managed to turn it into a complete PR victory.
-Hedge