As @RenegadeMatron says, when you're caught out, improvising with toilet roll is how most women cope! It's not great, but it's one of those inherently female experiences most of us can relate to vividly.
I've been asked for painkillers before by female friends/coworkers who have had a sudden attack of period cramps, but never sanpro.
Baskets of sanpro in customer toilets/public bathrooms are a really nice idea, and I like that. Have you ever used a cheap pad before? I tried them once as a student - they were dirt cheap, but they didn't stick very well and were so bulky they chafed. The sanpro that people tend to leave out is branded, and therefore so much gentler. Digressing slightly, period poverty is a thing, and it's ridiculous that any woman has to walk around with terrible sanpro or toilet roll on a regular basis. For some women, the toilet roll isn't just when they've been caught out, it's throughout the period.
Realising you've been caught out can be fairly humiliating depending on at what point you've realised - I think in a nightmare situation, a woman (more likely to be a young girl, TBH) would seek help from other women in the ladies. I can't see any woman asking a man for help in that situation, unless they were exceptionally close, like a partner or a brother. I certainly can't see any woman asking a random man for a tampon. You'd feel vulnerable enough to start with.
Digressing again, what so many men don't seem to get is that the ladies toilets are a place of safety where even the meanest of women will be nice to each other. If you found yourself unexpectedly bleeding, you'd run there, you wouldn't look for a man and ask him for help. You'd run to the toilets and if you couldn't help yourself, you'd ask another woman.