Maybe it's just a coincidence. But maybe there is a poor contact (high resistance) in the ignition switch and the brake lights took enough current to drop the voltage at the stop solenoid to the point that solenoid released and stopped fuel injection. That's a guess. What year/model is your tractor? This theory would only apply to the later two versions of the stop solenoid (2005 and later, I think).
If your key switch is getting wonky you might try spraying contact cleaner into the keyhole or disassembling, cleaniong, and reassembling the switch. A new switch is in the vicinity of $100. Switch removal and installation is easy, especiallyu if your switch is on the "dash board" vs the steering column.