Can we Control DPDT switches by using Arduino/ESP32?

By writing a logic HIGH to pin 12.

By the way, the battery wiring, voltage and ID are wrong in my diagram, because I didn't realize your first example was a complete fiction.

So please explain what battery connects to what device, and how, then we can refine it. But the relay transistor drive will remain similar or the same.

Please, stop calling the relay a "switch". It will confuse everyone. Also please tell us which power source the relay is supposed to be powered from.