Hint 1
All right, here's an example of a way in which this puzzle can be solved:
First off, move the engine over to the left and couple it to the railcars. Then drag the railcars to the top section of the loop and leave them there. You need to uncouple from both railcars, so make sure you touch the blue railcar, not the red one.