"31 people were attacked in all of Scandinavia between 1977 and 2012. Few of the attacks had deadly outcomes and almost all took place during a hunt."
https://sweden.se/nature/swedens-most-dangerous-animal/
Turns out if you leave them alone they leave you alone. You don't need to 'defend' yourself against them, let alone with firearms.
Animal attacks are real, and even when you leave them alone they won't always leave you alone. That said, bear spray is much more effective than a firearm, and has saved my brother's life in the past.
Let's look at the data in aggregate instead, in order to make a decision, using the link I already gave. It's an extraordinarily low risk. I'm not even sure how quickly a hiker could bring a rifle into battery when they're just hiking along. And a pistol isn't going to stop a large animal. Whole thing seems unrealistic to me.
A female bear is startled and charges towards the people, the researcher keep his ground and the bear makes an arc to avoid crossing paths.
Moose is the biggest killer in the area with difference. They are really dangerous when involved in car crashes because they have very tall legs, so in an accident the animal is pushed trough the windshield inside the car. Then, the struggling moose trying to break free, typically will hit repeatedly the driver in the head and torso with his legs
Which is why the #1 preventative step taught in Canada (where we also have large bears and moose) is to be noisy. If the Bear, Moose, Deer, etc can hear you from a decent distance, they'll get well out of your way before you even know they're there.
I've been camping since before I can remember (literally) and the only "protection" we bring is mace and bear bangers (basically tiny fireworks without the lightshow). We've come across bears a number of times, but never had to use either. Just talk loudly and make some noise, and they just wander away.
I think the reason so many attacks happen to hunters is because they're trying to be stealthy and end up sneaking up on them (whether on purpose or or not), which is when they are dangerous.