Your connection shows you are using hardware serial pins with Nano. Your code uses softwareserial on pins 3 and 4. That's not matching.
We use hardware serial built in usb to debug in IDE serial monitor. So we can only use software serial for Tx Rx which is in pin 3,4
From my experience those commonly available Max485 modules work reliably powered at 3.3V. No need to abuse your Esp32.
Haven't try this , will test this is easier