We use various methods of Borel integration to calculate the binding ground energies and masses of bb and tt quarkonia. The methods take into account the leading infrared renormalon structure of the (hard+)soft part of the binding energies E(s), and of the corresponding quark pole masses mq, where the contributions of these singularities in M (s) = 2mq + E(s) cancel. Beforehand, we carry out the separation of the binding energy into its (hard+)soft and ultrasoft parts. The resummation formalisms are applied to expansions of mq and E(s) in terms of quantities which do not involve renormalon ambiguity, such as MS mass mq and αs(µ). The renormalization scales µ are different in calculations of mq, E(s) and E(us). The mass m b is extracted, and the binding energies E tt and the peak (resonance) energies Eres. for tt production are obtained. This is the version v2 as it will appear in Phys. Rev. D. The changes in comparison to the previous version: extended discussion between Eqs. (25) and (26); the paragraph between Eqs. (32) and (33) is new and explains the numerical dependence of the residue parameter on the factorization scale; several new references were added; acknowledgments were modified. The numerical results are unchanged.