Render parts of object(s) only when they are within a defined area
With Holdout:

Create a layer with the train and with a holdout object both visible (make sure that the holdout object is alpha blend and no shadow):



Create a second layer with neither of these 2 objects visible:



Render and mix in the Compositor through a Color &gt; Alpha Over:


Or create a black and white image that will allow you to mask the left part:


Create 2 layers, one with the train, one without, use the black and white image as a mask in the Compositor: