Give the wagon two variables "oldx" and "oldy", then the events are as follows:
+ System: Start of layout
-> wagon: Set 'oldx' to .X
-> wagon: Set 'oldy' to .Y
+ Sprite: Sprite overlaps wagon
-> Sprite: Set position to .X+wagon.X-wagon('oldx'), .Y+wagon.Y-wagon('oldy')
+ System: Always (every tick)
-> wagon: Set 'oldx' to .X
-> wagon: Set 'oldy' to .Y