I have read numerous accounts of this being done (Disclaimer: not everything you read online is true. I have not seen any actual scientific studies on this subject - only stories posted by aquariumists. I've been criticized in the past for stating stories like this as fact, so I just wanted to point that out.). According to these accounts, the survival rate is extremely low unless the fry are fully developed and ready to be born (such as when the mother dies in labor). In cases where the fry are still developing inside the egg, most people report that none of them survived to hatch. In some cases, only one or two eggs survived to hatch. Apparently, developing inside the mother seems to be crucial to their development (probably some regulatory functions like oxygen/CO2 transfer or something like that). Additionally, emerging from the mother also seems to be a crucial step in their development (perhaps like butterflies who develop enough strength to fly by struggling to emerge from their cocoon). The few fry that do manage to hatch outside the mother are usually reported to be frail and weak, and often die.
As for how long you would have to do the C-section before the fry would be dead, not very long. The mother's body is a sealed system, and the fry/eggs would quickly run out of oxygen after her death (like locking a bunch of fish in a tiny bag without air - they won't survive in there for very long). You would need to cut them out immediately (preferably before the mother's gills stopped pulsing).