When I start my truck, brake lights work. When I start driving, brake lights quit working (the one on cab still works, but not the two on the bed). They don’t work again until I restart the truck.
Check your trailer plug wiring, looking for where it could have rubbed the wiring bare on the frame or hitch.
Not an uncommon problem on older trucks.
If that doesn’t work you (or you shop) will have to enlist your voltage test meter and start at the tail-light and work towards the battery, following the wiring diagram along the way. Eventually you’ll find the point where the proper brake light voltage doesn’t continue to the next segment. Bulb socket, brake light switch, and brake light fixture ground connection are common culprits.