The train does its shopping at the market in Juliaca. The picture shows it collecting some fruits.
The Julliaca market stretches over every available square meter, including the railroad main track. Until the very last minute, the track is covered with booths and arrays of many kinds of merchandise. When a train comes, everything is not removed. The train just steps over some of the merchandise. The business resumes right after the last car is gone.
Note that the switch is a major junction: here, at the north entrance of the city, the line on the left coming from Arequipa joins the line from Cuzco for the last section to Puno.