Etz Yosef on the midrash brought by Rashi:
שראוי לעונשים שכן היה השיעור קודם מתן תורה (רש"י בחומש ועי' בנזה"ק) ואע"ג דבמבול מתו גם הקטנים. בעון אביהם מתו:
Translation:
"That is deserving of punishment, for such was the measure before the giving of the Torah. And even though in the Flood young ones also died, they died from the sin of their father."
Similarly writes Gur Aryeh on Beresheet 14:13:
ואין לומר בשביל שלא הגיע לעונשים, דאם כן בני דורם ינצלו כל אשר הם פחות מבן ק', אלא על כרחך כל אותם שלא הגיעו לק' מתו במבול בשביל אבותם, דבעון אבות בנים מתים (ראה שבת לב ע"ב), וגבי נח שהיה צדיק אמרו (ב"ר כו, ב) שבניו נצולו בשביל שלא הגיעו לעונשין
Translation: "...and it should not be said that [he survived] because he [Og] didn't reach [the age of] punishment, for if so, all those sons of their generation should be saved because they were less than one-hundred years old, so you must say that all those that hadn't reached one-hundred died for their fathers, for in the sin of the fathers sons die, and about Noach who was righteous they said that his sons were saved because they hadn't reached [the age of] punishment..."