Beam lifetimes of stored ${\mathrm{U}}^{28+}$ ions with energies between 10 and $180\text{ }\text{ }\mathrm{MeV}/\mathrm{u}$ were measured in the heavy ion synchrotron SIS18 and in the experimental storage ring (ESR) of the GSI accelerator facility. By using the internal gas jet target of the ESR, it was possible to obtain projectile ionization cross sections for collisions with ${\mathrm{H}}_{2}$ and ${\mathrm{N}}_{2}$ from the lifetime data. The experimental cross sections are compared to theoretical data predicted by the $n$-body classical-trajectory Monte Carlo (CTMC) method of Olson et al. and to calculations of Shevelko et al. using the LOSS-R code. In addition, both theoretical approaches are probed by using the resulting cross sections as input parameters for the STRAHLSIM code, which models the beam losses and, consequently, the lifetimes in the heavy ion synchrotron SIS18. Both the cross section measurement and the SIS18 lifetime study indicate that the LOSS-R code cross sections are in better agreement with the experimental results than the $n$-body CTMC calculations.