Hello and Thank you for chooising Just Answer.
More than likely the Brake Pedal Position or BPP switch is bad causing the brake lights to not come on for both the vehicle and trailor. The switch is located under the dash on the brake pedal arm.
OK then. You may have a wring problem. I will give you the electrical pinpoint test from Ford that you can do with a volt meter.
Do not click the blue links, All the information you need is already there.