The train will move along the track. When it gets to a station where there are passengers waiting the passengers will board the train if it has room. The passengers will get off once the train reaches their station. You can tell which station a passenger is headed to by it's colour, which corresponds to the colour of the station it's heading to. Passengers randomly generate every few seconds with a random starting station and a random destination station. The destination station will always be further down the line than the starting station. So passengers that generate headed westbound at the light blue station will only ever have a destination of the yellow station. Similarly, passengers that generate headed eastbound at the purple station will only ever be heading to the magenta station.
I experimented with clones in this project: https://scratch.mit.edu/projects/1008333821/ It turns out I didn't need to structure the code in this project the same way as I did in the project linked above. I found a more efficient way of achieving the same result.