The rectifier changes the track voltage which is 18 VAC to 18 VDC.
The alternating current voltage is typically measured as an RMS value, that is, using a root mean square that "averages" the voltage of positive and negative swings. A rectifier converts AC voltage to DC, but that is a combination of positive and negative peaks that ends being 1.414 times greater than the AC RMS value. That means that 18VAC ends up being nearly 25.5 volts DC out of the rectifier. That increase means that one must carefully choose a big enough resistor to restrict that current flowing to the LEDs at the higher voltage.