Heya Kane,
The two capacitors directly to the right of the dotted line are placed there due to the transformer power supply. The 2200uF capacitor is for ripple filtering and so that the voltage is supplied from the capacitor, rather than the bridge. This is setup to allow smoother voltage to the remaining regulator circuitry, as well as protect the bridge from overheating from "constant" use. In other terms, the 2200 uF capacitor is the the middle-man who takes the raw material from the transformer and refines it for use by the circuit. The 100nF capacitor is installed for a high frequency response, again for the supply voltage and additional smoothing of the voltage to the regulator circuit. Thus, the 100nF capacitor is the retail store which puts the finishing touches on the product and supplies to the customer, which is the LM317. A final note, these two capacitors are there to filter the input voltage from the transformer.
You may need to do a little investigation. If the power supply that you already have (The train power supply) is only a transformer and a bridge, you'll need to include the circuit as you have labeled with the dotted line.
If the train power supply already has some sort of filtering capacitors (If you see a large capacitor in the range of a couple thousand uF) then you should be okay with eliminating the 2200uF capacitor. In this case, I would leave the 100nF capacitor in the circuit (which is what the datasheet specifies for input voltage filtering) Thus, you're just eliminating the 2200uF cap.