It's one of those situations where you're either way ahead or way behind on the flop. If SB/BB had bigger stacks than you, then I think I would have folded in that situations, since it's highly unlikely they'd both be going all-in with nothing. And if anyone was making a move with an Ace high flush draw, you would still be 50/50 to win. In either way, if 2 guys go all-in behind you, you should go all-in with a set+, because you'll be behind with an OP most of the time.
And if you folded there, you would still have 25BB left, which is enough to get back on your feet and look for a better chance to move your chips in.
And relying on what your gut tells you helps most of the time