For Provident Fund, there is no retirement age. Therefore, as suggested by Rohit, you can put the entire 12% of the employer's share into the provident fund account along with the employee's share of 12%, without bifurcating it as 8.33% to the Pension Fund and the remaining 3.67% into the Provident Fund.
Regarding the payment of Gratuity, if gratuity is not paid at the time of retirement, you can add the service to the continuing service. In such a case, whenever he leaves and gratuity becomes due, the service will be counted from his initial day of service.
In practical terms, companies make employees retire at the fixed superannuation age, i.e., in your case, 58, and settle their gratuity. Thereafter, they issue a fresh appointment order on a fixed-term contract basis renewable every year.
Regards,
Madhu.T.K