In my personal opinion, such a situation should be viewed from the HR policy perspective of the organization rather than a legal perspective. For instance, if you consider the practice adopted in government service, the process of transitioning an existing employee from a lower cadre post to a higher cadre post in the same department or another through direct recruitment is not treated as termination of service but as a transfer of service only. This is to enable the incumbent to maintain continuity of service and leave benefits, subject to the condition that the employee ensures there is no break in service.
Regarding the specific point you raised, if the leave conditions are the same for both posts, then since the employee and the employer are the same, the existing leave account can be continued. As I mentioned at the outset, it depends upon the policy of the organization.
Thank you.