It is misleading to a small extent to say the DCC decoders are very expensive. Two things determine the cost of a decoder. One is whether or not you want sound. If you do, yes it is a lot more expensive than just motor control. The second thing to consider is current draw. Like all electronics, the current through the decoder is very important. The more current you need, the larger the components, the larger the decoder, and the more expensive. The $52 NCE decoder mentioned above I think is probably the D408SR model. This is designed for high current draw. It has a rating of 4 amps continuous, and the latest versions I think are rated at 10 amps stall. This decoder will probably run any O scale loco from any era. I am using them in older Max Grey imports that can draw 2-2.5 amps under load. These are 10 drivered large locos with 50s era motor.
On the other hand I have newer models some even from the 1980s that draw less than one amp under load. I have 2 Sunset steamers from that era. I found a Digitrax DH123 decoder for under $20 that is rated at 1.5 amps continous and 2 amps stall. I have used this decoder in a bunch of locos that have low current draw including some 2 rail, 2-motor diesels from MTH. I have been able buy decoders at this rating for even less than $15
In both cases these are motor and lights only. the 408 has outputs for 7 things (lights, smoke, whatever), as lo0ng as total output from the decoder is maximum 4 amps. The 123 has only 2-3 - generally headlight and backup light and the maximum cannot exceed 2 amps.
If you put an ameter in series on either lead to the track and run the loco at 12-13V, the meter will show the draw. You want to hold it so you get it under load and see what it does. Then you can stall it so the wheels slip and see what you get. Once you know what the loco draws, you can go shop for a decoder that has the features you want, and the current rating you need.