I am not a loco man, but my understanding is this.
1) A two cylinder engine, whether single or double acting has the cranks set at ninety degrees to ensure self starting.
2) Full scale locos, intended to run at speed had three, or possibly, more often, four cylinders, to improve the balancing. Weights added to provide primary balance, result in a secondary out of balance force, at right angles to the primary.
In a loco, this results in hammer blow, which increases the loads, and therefore, wear on the track.
This does not endear them to the civil engineers, who reduce the maximum allowed axle loads to compensate!
Reputedly, a type of loco built and used on (I think) the LBSC, had greatly reduced primary balance, to minimise hammerblow, but they gave the passengers in the front carriage a very rough ride, shaking them to and fro!
By using more cylinders, the balance weights become smaller and lighter, decreasing the secondary out of balance forces.
As a digression, the Brough Superior motorcycle (Known, with R-R agreement, as the Rolls Royce of Motorcycles) always used two cylinder ninety degree twins. With each cylinder subjected to primary balancing, the secondary out of balance matched the forces from the other cylinder.
Unfortunately, it is not really practicable to build locos with the cylinders, (as opposed to crankpins) disposed at ninety degrees to each other.
Ninety degree V4 and V8 engines are smooth, rotationally, and well balanced, vertically and horizontally, but tend to squirm because the various forces become distanced from those that they are supposed to counteract.
In the model world, hammerblow may be of less consequence, because, although the rails are smaller, lighter, and much less strong . ( Beam strength is related to the cube of the beam depth) The out of balance forces are related to the square of the speed, and the components involved are so much smaller (and since volume is effectively a square law effect) much lighter, so drastically reducing the forces.
The Romney Hythe and Dymchurch Railway, at one third scale, had two locos, designed by Henry Greenly, with three cylinders. But with the additional complication, and the difficulty of the boiler being able to feed three cylinders adequately, they were converted to two cylinders. To this day, they acquit themselves well.
Howard