Never say never, but in full-size beam engines weren’t used to drive dynamos because the RPM are too mismatched, Beam engines turn slowly, perhaps 30rpm, whilst dynamos work best at high-speed, 3000rpm or more. It’s an inefficient combination. better alternatives available.
If a model dynamo is required to generate significant power, then a 100x step-up is needed, eek. Not a step-down. Belts and gears both struggle to deliver a 100x ratio, so the answer is a faster engine – higher rpm.
Traction engines manage about 200rpm at the flywheel, which is geared up by a belt 4 or 5x to spin the dynamo at about +1000rpm. (Large diameter to small dynamo pulley.)

Traction engines are too slow to generate electricity efficiently, but they made sense in a fairground. Actually all reciprocating steam engines fall short, and they vibrate badly, though the high-speed Willan’s Steeple Engine, was once widely used. Turbines are best for making electricity.
For demo purposes a slow turning dynamo (5×30=150rpm) spun by a beam engine might produce enough volts and amps to light up a string of LEDs, but not paralleled filament bulbs off a xmas tree. Try spinning the dynamo by hand to see what the output is at low rpm.
Nonetheless, beam engine with dynamo makes a good display model. Beam engines are a joy to watch because they move so slowly it’s clear how they work. And always good to see models doing something, like powering a line-shaft that spins a miniature lathe or illuminating the world.
If verisimilitude matters so many rules are broken by driving a dynamo with a beam engine that I feel it’s not worth worrying about gear DP. If done at all, full-size would use belts, and there would be no Light Emitting Diodes!
Belts are easier than gears too…
Dave