Special solutions for outdoor model railroading.
I think you will find that that is OK for AVR devices, e.g. standard Arduino, but ESP8266 and ESP32 are not atmega devices.. so Arduino for ESP uses an "Esptool" in place of the avrdude tool
I have found a nice NodeMCU Firmware flasher (https://github.com/nodemcu/nodemcu-flasher) that works for the ESP8266 and is simple to use. (tested it once only so far!!)
The ESP32 versions so far have not been simple enough for me to be able to recommend them. I will try and add something to my user pages when I get something I think will help others.
There is also quite a lot of stuff on the web to allow Over the air uploading, and I have used that a lot. Its faster than serial, and much more convenient when the node is in the garden.. BUT if there is an error in the new code, or an incompatibility of some kind, it will prevent future uploads, whereas with serial you can soon see if there is a problem and try to fix it.