I have asked myself that, and being reasonable; I would probably try to help. First reason is, I have empathy, I don't want to see anyone die from suicide, because that would mean they are/have been in extreme mental and/or physical pain. In an ideal world, everyone would be able to be happy enough not to have to resort to that. It's sad, in my opinion, when it happens. No, that doesn't mean I would want them to prolong their suffering out of selfishness. Obviously, it should be their choice and there's nothing wrong with that. But, like I said, I would probably panic and jump into action upon seeing someone dying.
Second reason is the main reason why I'm almost sure I would help: if I were trying to end my life, about to jump to death, for example, and someone just saw me and did nothing, I would feel like shit, to be honest. I'd feel like, fuck, nobody even cares. Of course I'd be very angry if they *did* help and I failed; but I feel like that's way better than my last moments being, wow, a stranger just saw me about to jump off a building and did nothing.
Now though, this is different than if someone close to me told me they want to CTB because they're in pain. That's not the same as walking in on it if that makes sense.