HI there,
Both items, the brake switch and/or the brake transmission shift interlock solenoid could be the culprit.
What I would suggest is to listen for the brake lamp relay click below the passenger side toe board. If you have the click, the information is getting to the BCM to release the solenoid and you have a sticking shifter assembly.
But I would be thinking shifter assembly/solenoid than the brake switch.
Allthebest, TCM