Disclaimer: I would rather this thread not degenerate into the old "which caliber is best for grizzly bear" argument.
All things considered, if you were flying to Alaska and then taking a driving trip to tour the state, not camping, but some time in national and state parks, with day hiking, but not in back country, what gun would you want to have with you.
I think risk of an animal attack in such a scenario would be lower than risk of attack by a dangerous person. Never been to Alaska.
Your choice of sidearm to bring would be Glock 9mm (probably 43X), Ruger GP100 with 3" barrel, Glock 20, or Glock 29.
I am leaning towards the 9mm because I am perceiving the need for self defense against another person is more likely than against an animal, and the Glock 9mm is easier to carry all day.
Forget the 9mm fantasy ...
Worse, you’re trying to predict the “more likely” scenario when, in Alaska, both are not only possible, but in that state specifically human encounters with apex Bruins, and even agitated moose, is a regular occurrence.
Of those handguns you named, a hot-loaded G20 makes the most sense, as it can cover both types of adverse encounters. That’s provided you’ve practiced drawing and shooting it, fast and accurately, with the same ammo you’ll be carrying.
Up there, proper 10mm ammo selection for excursions into the bear-infested boonies is best described as, “heavy & fast,” i.e., 200grns-220grns FMJ-FP or polycoated hard-cast FN @ 1200fps-1275fps.
Look to UW, DT, and BB for what’s available in that range.
Holster your G20 in one of the center-chest rigs on the market and you’ll be as well armed as Denmark’s Sirius Sledge Patrol soldiers. The Gen4 G20 is their issued sidearm for occasional encounters with polar bears in the arctic regions of Greenland.
You can thank me when you get back.