Yes, that is possible and not very difficult to do.
If you're operating conventionally, the instruction manual that accompanies any PS2 subway or trolly will have instructions. Click on this link and look at pages 8-9 if you don't have the manual that came with your subway.
If your using DCS, you can download the addendum to the DCS Users Guide at this link. Unfortunately, thsi link appears to be not working at this time.
Alternatively, you can find a more detailed discussion of this on pages 103-107 of The DCS O Gauge Companion 2nd Edition.
This and a whole lot more is all in MTH’s “The DCS O Gauge Companion 2nd Edition", available for purchase as an eBook or a printed book at MTH's web store!