On top of what Avik has suggested, you need to take in consideration of possible case locking issues.
Given that you will try to resolve all parent and remaining child cases, you might or might not always be able to take lock on all of them at the same time; though this depends on your case type locking setup.
If this is a possible scenario, then -
1. You can queue this task to a queue processor with multiple retry attempts configured.
2. You can still try to do it on foreground, but first check if you can take lock on all cases. If not, show an appropriate error message to the end user.