First you will find below a utility function to get the Childs array from the parent product category. Then you will be able to use it in your hooked function.
You can handle multiple parent product categories with different text buttons.
Conclusion In summary
features added:
How to rename ad to cart button based on parent category.
You can rename more than one add to cart button from different categories.