Do you have a gratuity account with a bank? If yes, and it's a single account for consolidation, then no issues; money comes directly from there in favor of the beneficiary.
Gratuity Accounting Practices
Does the finance department keep gratuity accounting separate and show it as a liability? If yes, then Mr. Bandyopadhyay suggested the first legal entity transfer money to the second and then pay. If the legal agreement states that the company has the rights to transfer to subsidiaries or holdings as needed, find a way to apportion and pay it.
In essence, we need to pay if the payment terms are matured.