Yes if you do the ewes 4-6 weeks before lambing it will give the lambs protection for the first few weeks of life through colostrum antibodies. That protection starts to weaken though after about 4 weeks give or take, so that’s when you give the lambs their first dose, and then again 4-6 weeks after. This should then protect them for a full year. If you’re keeping any to breed from I would then do their annual booster when you do the pre lambing booster, then they are in sync with the flock ewes (so my March born lambs had their first jabs over Easter weekend, and having the second tomorrow. Then the ewe lambs will have their booster in January which will then put them on the annual booster programme with the ewes).
Just make sure the lambs are dry when you inject as heptavac can cause abscesses if injecting with wet fleece.