Axions in the Peccei-Quinn (PQ) mechanism provide a promising solution to the strong CP problem in the standard model of particle physics. Coherently generated PQ scalar fields could dominate the energy density in the early Universe and decay into relativistic axions, which would conflict with the current dark radiation constraints. We show that a thermal inflation driven by a U(1) gauged Higgs field dilutes such axions. We discuss an available baryogenesis mechanism for the U(1)B−L​ gauge symmetry