The present constraint on the space parity ($mathcal{P}$) and time reflection invariance ($mathcal{T}$) violating electron electric dipole moment ($e$EDM) is based on the observation of the electron spin precession in an external electric field using the ThO molecule. We propose an alternative approach: observation of the $mathcal{P}$,~$mathcal{T}$-odd Faraday effect in an external electric field using the cavity-enhanced polarimetric scheme in combination with a molecular beam crossing the cavity. Our theoretical simulation of the proposed experiment with the PbF and ThO molecular beams shows that the present constraint on the $e$EDM in principle can be improved by a few orders of magnitude.