Polyatomic polar molecules are promising systems for future experiments that search for violation of time-reversal and parity symmetries due to their advantageous electronic and vibrational structure, which allows laser cooling, full polarization of the molecule, and reduction of systematic effects [Kozyryev and Hutzler, Phys. Rev. Lett. 119, 133002 (2017), 10.1103/PhysRevLett.119.133002]. In this paper we investigate the enhancement factor of the electric dipole moment of the electron (Eeff) in the triatomic monohydroxide molecules BaOH and YbOH within the high-accuracy relativistic coupled cluster method. The recommended Eeff values of the two systems are 6.42 ± 0.15 and 23.4 ± 1.0 GV/cm, respectively. We compare our results with similar calculations for the isoelectronic diatomic molecules BaF and YbF, which are currently used in the experimental search for P ,T -odd effects in molecules. The Eeff values prove to be very close, within about 1.5 % difference in magnitude between the diatomic and the triatomic compounds. Thus, BaOH and YbOH have similar enhancements of the electron electric dipole moment, while benefiting from experimental advantages, and can serve as excellent candidates for next-generation experiments.