Abstract: The mobility and quantum time of Dirac electrons in HgTe quantum wells with near-critical thickness corresponding to the transition from the direct to inverted spectrum are experimentally and theoretically investigated. The nonmonotonic dependence of the mobility on the electron concentration is experimentally established. The theory of the scattering of Dirac electrons by impurities and irregularities of the well boundaries leading to well thickness fluctuations is constructed. The comparison of this theory with an experiment shows their good agreement and explains the observed nonmonotonic behavior by a decrease in the ratio between the de Broglie wavelength of Dirac electrons and the characteristic size of irregularities with increasing electron concentration. It is established that the transport time is larger than the quantum time by almost an order of magnitude in the case of the dominance of roughness scattering. The transition from macroscopic to mesoscopic samples is studied and an abrupt decrease in both the mobility and quantum time is observed. This behavior is attributed to the size effect on the free path length.