Answer
(Fatwa: 422/422/M=1432)
In the question mentioned above, salah shall be valid. However, if such situation happens the Imam should not return from Qiyam to Quood (sitting). He should stay in Qiyam and perform sajdah sahv in last due to missing a wajib.
فلو عاد إلى القعود بعد ذلك تفسد صلوته لرفض الفرض لما ليس بفرض و صححه الزيلعى و قيل لا تفسد لكنه يكون مسيئاً يسجد لتأخير الواجب وهو الأشبه كما حققه الكمال وهو الحق بحر، (درمختار)
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband