First and foremost, your question is not clear to me. As one of the respondents suggested, gratuity is a terminal benefit in the event of any type of termination of employment stipulated in the Payment of Gratuity Act, 1972. You have mentioned that you also accommodate the persons on the payroll of your clients as your contract employees when you are told to do so. Keeping aside the ethics of such an act and the vulnerable sentiments of the employees, what has happened is the transfer of service of the concerned employees from the Principal Employer to that of the contractor. Therefore, as the contractor, the concerned employees' services start from the dates of their transfer and are still continued, albeit as contract labor. Hence, where is the question of termination as of now? Even with the Principal Employer on their direct payrolls, it is only two years, and no eligibility for gratuity arises. You have also stated that your client would pay you the amount, ending in a doubting note whether you should pay such an amount as gratuity to the resource. Anyone with common sense and a bit of legal knowledge can easily presume that the entire deal is questionable. I have seen many Principal Employers treating contract labor as a source of regular labor recruitment, but your situation is quite the opposite. I am afraid that at some point, you both may land in trouble, as it is an act of unfair labor practice.
Please let me know if you need further clarification.