Think there are 2 different approaches to this; both interesting:
Standard:
https://rebrickable.com/mocs/MOC-6201/supertruper1988/79111-m-motor-power/#comments
Motorized Caboose:
https://rebrickable.com/mocs/MOC-2047/deafpilotboy/moc-motorized-caboose-for-lone-ranger-constitution-train/#comments