It is for the Bank to act in terms of the said agreement and exercise all rights under the said agreement as against the debtor. The Bank could not have adjusted the same from and out of gratuity amount, which are protected under Section 7 of The Payment of Gratuity Act, 1972.
You can issue a legal notice and demand reversal of the deduction failing which you can approach consumer forum with a complaint for deficiency in service and also for unfair trade practice for contradicting the loan agreement conditions.