Here is a force diagram for a tiny object pulling a massive object with no friction. For the train (object B), a frictional force is pulling to the right.