My guess is wiring. Start at the tongue and trace the wiring down to each brake. Redo any connection you find. Look for wire insulation rubbed through where the wires enter and exit the axle tubes.
Best bet is to run all new wires minimum 12 gauge, 1 wire per brake on the outside of the axle tubes. Join all 4 brake wires (2 wires for a single axle trailer) into a junction box near the tongue. Then join the brake wire from the tongue to the 4 brake wires in the junction box.
Make sure you have a ground wire from the trailer to the tow vehicle. Don't rely on the trailer ball for the ground.
Now test drive.
.
2001 Suburban 4x4. 6.0L, 4.10 3/4 ton **** 2005 Jayco Jay Flight 27BH **** 1986 Coleman Columbia Popup