Do you mean brake LIGHTS or the actual brakes themselves, bit confused.
Assuming it's the lights, then do a check by bridging the two wires together that go to the switch, if the lights work the switch is duff, if not then need to do a resistance/continuity test on the wire that goes from the switch to the rear brake lights, but yes as friend said if needed can replace the wire to sort out, though much more likely to be a connection problem.
This assume both bulbs are ok ?
tabetha