Some Mazdas put the metal-cased engine computer in a plastic air box that feeds cold air from the front, to help ensure the engine computer stays cool enough.
In general, I believe the cooling airflow from the frontal air and the cooling fans keeps engine bay in check.
For example, this is the board that’s used in Mazda CX-5 2017+ engine computers (mfr Denso), it lists max temperature range of +150C: https://www.renesas.com/en/document/mah/rh850e1l-users-manua...