Evolution of antibaryon abundances in the early Universe and in heavy-ion collisions