Like the train car/cannon example, the largest part of the mass of
a rocket is actually the propellant.
Therefore, as propellant is being used up (combusted) during lift-off,
the mass of the rocket decreases and the acceleration increases to satisfy
Newton's Second Law.
This is why a rocket starts off moving slowly from the launch pad and
goes faster as it gains altitude.