Then the heat may be just building up from the thermal waste of the 5v regulator on the Arduino… it is just a little linear regulator and has to dissipate the “unused” 7v aprox. that the Arduino doesn’t need. this is where a little buck converter will help instead of the Arduino - 12v in, 5v out for the MCU, but usually done with more thermal efficiency.
As for the button timing and ensuring all relevant pins are LOW at boot… all best done in the MCU code, using PINMODE settings at startup, and timers to ensure the button (using virtual pins) has been pressed long enough to count (no trigger finger issues) but short enough to not waste energy on the relays.