Construction of the Linac Coherent Light Source II (LCLS-II) is underway for the world's first hard x-ray free-electron laser. A central part of the LCLS-II project is a 4 GeV superconducting radio frequency electron linac that will operate in the continuous wave (cw) mode. The linac is segmented into four sections named as L0, L1, L2, and L3. Two 3.9 GHz cryomodules, each housing of eight third-harmonic cavities similar to the cavities developed for the European X-ray Free Electron Laser (XFEL), will be used in section L1 of the linac for linearizing the longitudinal beam profile. In this paper, we present a study of trapped high order modes (HOMs) excited by a cw electron beam in the third-harmonic cavities of the LCLS-II linac. A detailed comparison of the original XFEL design and the LCLS-II design with a modified end group is performed in order to estimate the effect of a reduced beam pipe aperture on the efficiency of HOM damping. Furthermore, we apply a statistical analysis of the eigenmode spectrum for the estimation of the probability of resonant HOM losses and influence of HOMs on beam dynamics.