If the Imam didn't react on the invocation of "subhan Allah" the ma'mums should follow the Imam until the end because of this hadith or this. Once he finished they should tell him and then they will have to do sujud as-sahw. This applies if the Imam didn't forget something which is considered as fard/farz.
And here is a reference and an other Version of the hadith.
But if he forgot a farz/fard the matter would be a bit more difficult (because of different opinions and interpretations of the hadith):
It depends on: did the ma'mum know whether this was a mistake of the Imam or not, if no if he followed the Imam his prayer would be valid. If he knew then some scholars say one should complete the prayer in a valid matter as an example they said if an Imam stood up for a 5th rak'a if a ma'mum said "subhan Allah" and the Imam continued this ma'mum should finish his prayer, even if the others followed the Imam, but if two or more ma'mums tried to inform him then if they were right all ma'mums should end the prayer with the salam and leave the Imam pray the 5th rak'a. For the Imam himself if he was certain that his prayer was sane then he only has to do sahw, if not and he didn't react his prayer is invalid and he will have to repeat it. See here for example 658 or here (both in Arabic) and here in English.
You never do sujud as-sahw during the prayer but at the end of a prayer, this means before or after salam! Of course unless you have joined a prayer later then you might do it during the prayer and after finishing again, as the sujud you did was an addition to your prayer!
Some times the invocation of ma'mums can even prevent the sujud, for example if the Imam wanted to stand up and missed a sajda but was "informed" before his hands left the ground and react the good way!
According to at-Tirmdihi in a (not translated) commentary of the Hadith (of Dhul-Yadain) narrated by abu Huraira some people of Kufa said if someone speaks during his prayer because he forgot or not knowing that this is forbidden he should repeat his prayer. Imam ash-Shafi'i and Malik accepted the hadith as is, which means that in such a case one could speak. While Imam Ahmad said if the Imam was thinking his prayer is complete then he could complete it as usual after being informed but the ma'mum who knew it wasn't complete should repeat it, as he broke his prayer by talking!
And Allah knows best!