Ok...so the killer really is the inefficiency of the steam process...not the mechanism.
Can't be overcome.
As far as the mechanism...again just bench-racing, and knowing steam is way too inefficient...try this:
Two cylinders...horizontally opposed...centerline crankshaft...enclosed in a separate housing mounted to frame such that it can be unbolted slid out the front of the engine as an assembly...
Driveshaft runs length required to interface all drive axles...
Drive axles resemble modified versions of huge dump truck drive axles, with pinions rotated similar to army trucks...pointing upward...driveshaft interfacing with each axle and passing through to next axle to transmit power...axle housing suspended as required to allow movement as needed...
Everything direct drive...gear ratios selectable...
Unknowns (for me)...the biggest (to me) would be the overall width of two opposed cylinders with, say, a twenty six inch stroke...ground clearance not necessarily a problem...
Hey I'm just bench racing for fun...but let the rock throwing resume...lol...
I don't know why people are throwing rocks, it is one of the irritating things on here and in the 'real train' and model train community, where those who think they know a great deal seem to get something out of putting down those who ask 'silly' questions (and then wonder why the outside world, who have dealt with the less than charitable "rail enthusiast' or 'model train enthusiast', tend to have negative impressions about the communities), I don't know if they think it is a way of showing how much better they are, or it is their natural personality, but I wish they wouldn't do it...
And yes, the real issue is the inherent inefficiency of steam external combusion (a steam turbine can be orders of magnitude more efficient, but that is a different beast). Your concept if I understand it wouldn't buy you anything, you now have introduced all kinds of complexities, the connection between the cylinders and the crankshaft,then the gears required to translate the motion of the shaft to drive the wheels. Besides the complexity this introduces (and increasing the risk of breakdowns),you are adding a lot of friction into the equation as well with all those power redirects and gearing.
If you look at the external steam locotomotive, you have a shaft coming out of the piston that attaches to the drive wheels, while there are pivots involved it is a lot less moving parts then what you proposed above. I suspect internal components for a steam engine would be more about having some sort of 'clean' appearance or maybe some idea of safety (?...like when standing still the drive gear isn't particularly a problem, and steam engines accelerate so slowly that it is unlikely someone is going to get whacked by a drive rod or some other external gear...maybe scalded by steam from the piston being released.....)
And again, as others pointed out, having it 'all hang out' makes it a lot easier to maintain. Compare that for example brilliant car engine layout/design where you have to take half the engine apart to replace spark plugs or remove half the exhaust system to get at the oil filter, and you get the idea. Having this complicated stuff under the engine would make getting at it difficult, on a typical steam locomotive you can walk up to it and perform maintainance for a lot of basic things.