Yes it should also be included as if we try to ask only the force required to move only the engine then we will take the engine mass and it's acc.
So if we want to calculate the force required to move the engine with the 5 wagons ,then we will required to take the total mass to be
= Engine mass + mass of one wagon*5 * acc. produced .