You are already on leave and as such there is no possibility of resigning from the position while away from work, literally.
Once the maternity leaves are over you have to resume duties and later you may opt to resign but not otherwise. Remember you still have to handover the work to some other employee or as per the company policy and the period of notice has to be served unless the management decides to waive it. You cannot have the cake and eat it too, no question of taking maternity benefits after resigning once the employee resigns. It is for a purpose the Govt has initiated the policy to give enough rest to the mother and the child and employers are bound to implement. You cannot turn around and try to manipulate the benefit scheme to suit your career and still want the benefits.
Thanks and Regards