The least expensive solution is a direct drive hub motor (like this one:
https://www.amazon.com/LLY-Electric-.../dp/B07TKGMBJG) for the trailer with a switch (
https://www.amazon.com/FULL-THROTTLE.../dp/B07JP46TJP) The motor is to be used solely for braking, so you don't need anything but the hub motor. The three power leads (the big wires) on the motor are connected to the three positions of the switch, and the other three positions are wired together. When the switch is turned on, the motor is shorted and will provide a braking torque proportional to how fast it is spun. Do NOT try to disengage the brake until you are STOPPED.
Alternatively, you use a similar sized 3PDT switch to switch between braking and motor power - WARNING - you should be going very slowly or STOPPED when switching modes.
The wiring to the switch should be 10AWG flexible with very high strand count (
https://www.amazon.com/dp/B01ABOPO2S/) The hub motor should also have the ferro-fluid treatment
https://www.electricbike.com/ferrofl...-direct-drive/
The braking system I described is not regenerative braking, it is dynamic braking as has been used on diesel-electric locomotives for decades.
https://en.wikipedia.org/wiki/Dynamic_braking In this case, the windings in the hub motor are the resistive grid, which is why the ferro-fluid is important. A fan blowing on the motor certainly would not hurt.