As soon as you become the registered owner of the flat, you will become eligible to jointly purchase the freehold of the building. With that said, if the existing leaseholders have already started the process of buying the freehold, they will have to agree amongst themselves to allow you to join in.
To help your chances, it might be a good idea to ask your conveyancer to write to the leaseholders to express your interest in participating once your purchase completes.