  Scattering and decay processes of thermal bath particles involving heavy
leptons can dump hot axions in the primordial plasma around the QCD phase
transition. We compute their relic density, parameterized by an effective
number $\Delta N_{\rm eff}$ of additional neutrinos. For couplings allowed by
current bounds, production via scattering yields $\Delta N_{\rm eff} \lesssim
0.6$ and $\Delta N_{\rm eff} \lesssim 0.2$ for the cases of muon and tau,
respectively. Flavor violating tau decays to a lighter lepton plus an axion
give $\Delta N_{\rm eff} \lesssim 0.3$. Such values of $\Delta N_{\rm eff}$ can
alleviate the tension between the direct local measurement of the Hubble
constant $H_0$ and the inferred value from observations of the Cosmic Microwave
Background, assuming $\Lambda$CDM. We analyze present cosmological data from
the Planck collaboration and baryon acoustic oscillations with priors given in
terms of the axion-lepton couplings. For axions coupled to muons, the tension
can be alleviated below the 3$\sigma$ level. Future experiments will measure
$\Delta N_{\rm eff}$ with higher precision, providing an axion discovery
channel and probing the role of hot axions in the $H_0$ tension.
