Perovskite oxides are known to exhibit many magnetic, electronic, and structural phases as function of doping and temperature. These materials are theoretically frequently investigated by the $\mathrm{DFT}+U$ method, typically in their ground state structure at $T=0$. We show that by combining machine learning force fields (MLFFs) and $\mathrm{DFT}+U$ based molecular dynamics, it becomes possible to investigate the crystal structure of complex oxides as function of temperature and $U$. Here, we apply this method to the magnetic transition metal compounds ${\mathrm{LaMnO}}_{3}$ and ${\mathrm{SrRuO}}_{3}$. We show that the structural phase transition from orthorhombic to cubic in ${\mathrm{LaMnO}}_{3}$, which is accompanied by the suppression of a Jahn-Teller distortion, can be simulated with an appropriate choice of $U$. For ${\mathrm{SrRuO}}_{3}$, we show that the sequence of orthorhombic to tetragonal to cubic crystal phase transitions can be described with great accuracy. We propose that the $U$ values that correctly capture the temperature-dependent structures of these complex oxides can be identified by comparison of the MLFF simulated and experimentally determined structures.