Answer:
First scenario,
From 2nd Newton's law
F = ma
from the above eqn, it's evident
a = F/m
that is to say, acceleration is inversely proportional to mass
The greater the mass, the smaller the acceleration and the higher the acceleration, the smaller the mass.
Thus, You was in the wagon when it had the greatest acceleration because You has the smaller mass and thus the acceleration will be greater.
Second scenario,
Since Sara pulls with greater force and Force is directly proportional to acceleration according to the second Newton's law,
F = ma
then, when You is in the wagon it had greater acceleration since they have the same mass.
All the best!