The pressurized hydrogen-based superconductors are phonon-mediated superconductors characterized by high phonon frequencies. In these superconductors, the structure of the density of states (DOS) around the Fermi energy (EF) becomes important in evaluating their transition temperature (Tc) due to their high phonon frequencies. We investigate this phenomenon by calculating Tc of Im-3m CaH6 and Fm-3m ThH10 within the framework of the fully ab initio Eliashberg method without introducing any adjustable parameter. Our calculated Tc agrees with the experimental Tc quantitatively. Remarkably, the self-consistent calculation for the electron Green's function leads to smaller Tc in these materials due to the existing dip structure in the DOS around EF. This finding is in contrast to cases of systems with peak structures in the DOS around EF, such as Im-3m H3S and Fm-3m LaH10, providing a unified understanding of how structures of DOS affect the evaluation of Tc.