Interesting to think about as well...
In the answer above, 2 denotes the cars on the incline, while 5 denotes the cars on top.
This means, at any given time, the acceleration of the entire train depends on how many cars are on the incline, and increases as a fraction of the total mass with each additional car placed on the incline. 1 car, 1/5 of maximal possible acceleration, 2 cars, 2/5 of maximal possible acceleration, and so on, until all the cars are on the incline, where this becomes 5/5, or 100% of the maximal possible acceleration.
Conversely, with each additional car that is attached at the tail and not on the incline, the acceleration decreases by that amount. If we add another car on top, then the acceleration suddenly becomes 2/6 of the maximal possible acceleration, and each additional car decreases the total possible acceleration by that much. An excellent example of inertia at work, although it is not very apparent at first glance.