Praise be to Allah.
Shaykh Ibn ‘Uthaymeen was asked about this matter, and he said:
His ghusl for ihraam suffices for ghusl from janaabah too, because it is a ghusl that is prescribed in sharee’ah, especially since he forgot. The fuqaha’ stated that when they said: “If he intended to do a ghusl which is Sunnah, this will suffice for an obligatory ghusl as well.” Some of them limited it to cases where a person forgets, but both opinions apply in the case of this man, so that is sufficient for him. Fataawa Ibn ‘Uthaymeen, 22/373.