Keeping NodeMCU operating with a super capacitor
I've tried to find supply current draw for nodemcu, seems like it draws 35mA while operating and 300mA while using WiFi.

Add the voltage regulator idle current, about 5-10mA if it's a 7805. Let's say 40mA total with WiFi off.

Your suggested ultracapacitor has 65 ohms ESR (equivalent series resistance) so it would cause a quite high voltage drop : 40mA * 65 ohms = 2.6V drop, not acceptable on a 5V supply. This type of cap with high ESR is designed to backup SRAMs which draw microamps. It won't work in your case.

Reminder: \$ \frac{dv}{dt} = \frac{i}{C} \$

With a 1000µF cap and 40mA current, dv/dt = 40 V/s. 

So a 1000µF 25V capacitor placed BEFORE the voltage regulator will go from 18V down to 8V in about 0.25 seconds. It will work as a backup for 0.25s which should be enough for the short power interruption when the model train rides over a track switch. I've used 8V as a lower limit, it depends on the regulator, maybe it'll work down to 6V. If it is a switching regulator, it will be more efficient so it will last longer.

When using a cap as backup power supply you always want to put it before a voltage regulator, so the voltage on it is allowed to ramp down. If the voltage is not allowed to vary then only a tiny part of the charge stored inside the cap can be used, and a battery is usually a better solution.

Note that you should add a diode on the 18V line to make sure the cap does not discharge into the motor.

Now if the chip is transmitting over WiFi it will use a lot more current, so the capacitor will have to be a lot larger. You should add an interrupt in your code which detects power loss and immediately puts the micro in low power mode, or at least stops any wifi transmission.

In fact, if you put it in sleep mode fast enough when power is lost, maybe a much smaller cap value will do. That depends on how much of the rest of the circuit you can put in sleep mode, for example if there are LEDs or a motor driver, these will have to be turned off when power is lost to save energy, then turned back on when power is restored.