It is said that Tubman would threaten slaves who were feeling squeamish, to make sure they really made it all the way.
Some slaves would think the journey might end poorly and ask to go back. And that's when Tubman would allegedly pull out this pistol of legend. As a spy, she knew that any slave who returned would threaten all of the safe spots and the entire integrity of the Underground Railroad itself.
If you started the journey, Tubman would make sure you ended the journey, one way or the other. You weren't heading back if you started on the railroad. Or so she threatened anyway, I don't think anyone ever proved if she ever actually fired the gun. But I can see the badass sword + gun combo as an important threatening tool even if never used in violence.