If the third brake light is working, then the problem is not with the brake-pedal switch (or the third light would not work either). That the two lower brake lights stopped working together is also a ...
If your car's brake lights stay on even when the engine is off, the brake light switch -- a small, innocuous electrical part you'd only see once something goes wrong with it -- is likely the culprit.