Where I live we have a lot of mountain trails get creek and stream overflows, especially in the spring with snow melt and heavy rains. I've dunked and dropped enough bikes to have learned my lesson.
I now carry several large garbage bags in my kit now. When I come up to a submerged trail section or scenario as the OP shared, I now pull out two garbage bags, put one one each leg, secured to upper thighs with rubber bands and start walking into the water with a stick to check the depth and firmness of the base and then decide. Has worked pretty well for me the last 10 yrs or so. FWIW