We focus on the effect of the ionic radius of lanthanides and the number of electrons in 4f orbitals on the superconducting temperature in 12442-type iron-based superconductors RbLn$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ (Ln = lanthanide). In order to do that, we have studied the electronic properties of RbSm$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ and RbHo$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ with the largest difference in ionic radius and number of electrons in 4f orbital, and the largest difference in superconducting temperature by using first-principles calculations. We predict that the ground state of RbLn$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ is spin-density-wave-type in-plane striped antiferromagnet (SAFM), and the magnetic moment around each Fe atom is about 2 ${\mu }_{B}$. RbSm$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ has a great influence on the energy band near the $\Gamma$ point, and a Dirac-like dispersion energy band appears. This band is mainly contributed by the d$_{z^2}$ orbital of Fe, which proves that RbSm$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ has a stronger three-dimensionality. At the same time, this extra Fermi surface appears at the $\Gamma$ point, which also shows that Sm can effectively enhance the coupling strength within Fe$_{2}$As$_{2}$ bilayers. The charge density difference $\rho$(RbHo$_{2}$Fe$_{4}$As$_{4}$O$_{2}$)-$\rho$(RbSm$_{2}$Fe$_{4}$As$_{4}$O$_{2}$) also confirms it. This increases the internal coupling strength of the bilayer Fe$_{2}$As$_{2}$ layers, which in turn leads to a higher T$_{c}$ of RbSm$_{2}$Fe$_{4}$As$_{4}$O$_{2}$ than RbHo$_{2}$Fe$_{4}$As$_{4}$O$_{2}$. Determining the details of their electronic structure, which may be closely related to superconductivity, is crucial to understanding the underlying mechanism. Such microscopic studies will provide useful clues for our further study of other high-temperature superconductors.