The simple answer is yes
Grade is a big player in how many cars a train can pull. The draw bar force required for a given train goes up because part of the car weight is added to the level surface draw bar force. The amount of force the engine can pull is reduced by a portion of the engine weight.
Another player is the resistance of the track work. Specifically here it is the sharpness of the curve. I do not have it handy, but there is relationships that equate effective grade for various curve radius. I believe a 20 in radius adds the resistance equal to a 1% grade. Resistance here is another form of draw bar force.
The basics are that there is a certain external draw bar force level that will trigger wheel slip. This is a partial slip condition. The engine will continue pulling more force after this point. the engine speed drops as more force is required. Notionally when no more pulling force is produced, the wheels are in full slip. Other factors seem to have some impact here, but that is the fundamentals.
The force level when the slip occurs is influenced mainly by the force the wheel perpendicular to the track and the surface roughness of the wheel & the track.
The perpendicular force is the engine weight divided by the number of wheels in contact. This is why the engine weight is important. Adding weight increases the force values above by the delta weight times the coefficient of friction, with is in the neighborhood of 0.3.
The surface roughness works on the coefficient of friction part of the resulting force. This is where traction tires come into play. Depending on the material of the TT, this factor can approach 0.5. That is a 66% increase per wheel for the same engine weight. While that sounds impressive, traction tires have a limited functional life. Before they break entirely, they pick up oils & dirt that effectively reduces this coefficient factor. Changing them on steam engines is a real pain.
As with everything, the devil is in the details. In general the more contact surface area, the more force should be produced. More wheels driving then should produce more force & thus pull more cars. This is only true if the wheels have equal contact force. The reality of three points make a plane tend to work against that objective. The trucks of a diesel tend to be at the ends of the engine and our models free to pivot. Thus each truck has three contact points that are in full contact. The amount of contact of the others is dependent on how they are held relative to the plane.
In the case of steam engines, the drivers are held in place by a frame that does not have much ability to pivot on the track imperfections. So even if you have eight drive wheels on both a diesel & a steam engine, The diesel should have six points in full contact where the steam engine only has three. Yes the other wheels are providing some force, but you can see potential issue here.
Another factor in this is the weight distribution (balance). The typical steam engine has the drivers close together more or less in the middle. If you were to put the weight on one end, the number of full contact wheels could drop to two of less. The non driver wheels would take the rest of the weight which is not good for pulling force.
Articulated steam engines should buy back some of the contact points, depending on how flexible their frames are. the forward tends to float where the back is fixed like the non articulated
As indicate above, in general an engine with 12 drive wheels should pull more than an engine with 8 for the same weight and wheel surface conditions.
There are other factors that also seem to have an impact, but that is more detail than I think you want.