Yes. The rails are very flexible. That is why steel rails are used for laying tracks. They are flexible enough that they can be bent to lay curved sections of track, but are strong enough to bear the load of the train.
You can see the rails curving in a similar freight train in the following video. Note how sharp the curve is and how the rails too curve accordingly.