I managed to side with the Brotherhood and get their ending without destroying the Railroad. I just ignored Lietenant Kells and proceeded with the Institute missions until I got to Mass Fusion. Then I betrayed the Institute to the Brotherhood and it started the finale mission, completely skipping over "Tactical Thinking." Tactical Thinking was still listed as a quest in my journal after the Institute was a crater, but I just ignored it. I even did some missions for the Railroad that let me save assorted synths that made it out when I sounded an evacuation.
The only downside I could find was that it locked PAM into some kind of security override mode so that I couldn't talk to her anymore.
If at any point Kells walks towards you and tries to start dialog with you just break out of it and walk away. He will berate you, but the mission won't trigger and the Railroad won't get labeled as enemies.