It's probably fair to say that most people aren't familiar with the realities of military or mining equipment, much less space military and space mining. They see on TV that tanks and humvees look bigger and bulkier than their Honda Civic, so they assume military=tougher. They see that earth moving equipment looks even bigger and bulkier, so they assume that mining=tougherer. Part of it is probably that miners themselves are depicted as tougher and rougher than even military (who are shown having varying degrees of professionalism), so it "follows" that their equipment must be likewise tougher and rougher. Whether the writers themselves are also under this misapprehension is moot, as the audiences have this expectation and the writer must cater to it. Even car manufacturers (and those of other consumer goods) exploit this trope by making products bulkier, with a camo/industrial pattern, and calling it military/industry grade. So I would say there is not much basis to it, it's almost entirely a product of marketing at this point, especially with very popular media like the ones you mention.
In reality, the durability of both mining and military equipment can vary a great deal, and the only thing we can say for sure is that both will probably be at least a little more durable than cheap consumer goods that are explicitly designed for planned obsolescence.
Agility has historically been very important in almost every military context, from swords and rifles to battleships and aircraft carriers. When somebody is trying to attack you, moving away is always a fair option, as is going around their defenses when they are trying to defend. In mining, being able to move fast is not as important, so you can expect military equipment to be faster, while mining equipment is heavier (though not necessarily stronger as that depends on type of material as well).
However, the military deals with actual intelligent hostile actors. In mining the risks can be controlled. So mining equipment does not need particularly strong armor or any active defenses. For example, an infantry helmet is probably not "weaker" than a plastic hard hat, nor would you expect to find stronger body armor on miners than troops.
Militaries develop their own doctrines, and the nature of their designs is influenced by economics, resources, technology and many other things. An imperialistic military might be driven to cut costs and use cheap equipment to maximize the profit margins of its adventurism. Or perhaps there is a strong military-industrial sector that manipulates the government into overspending on overengineered designs. Maybe in your setting, slow and lumbering spaceships have an advantage (for example, spherical energy shields that exploit the square-cube law). Or maybe the military is not militaristic at all: For example, in Star Trek the "soldiers" walk around in tights and the ships seem fragile, but they're not really meant to be dreadnoughts, but vessels of diplomacy and exploration. Maybe with humanity going to space, central governments become very weak, and militaries are just underfunded, vestigial organizations who have all but faded into irrelevance as giant asteroid mining mega-corporations raise space armies that put the East India Company to shame.
On the mining side, it is worth recognizing that the miners themselves are likely capitalist entities, as are the suppliers of their equipment. You would expect designs to tend towards whatever maximizes profit. This can be extremely durable equipment, or very flimsy, throwaway but cheap equipment. The efficiency of the market is also a factor. With large, well-governed mining corporations, the equipment manufacturers may expect serious scrutiny of their product and thus aim to produce quality. But if miners are either bloated enterprises or many small time individuals, they may be more susceptible to deceptive marketing and the equipment may be low quality as a result. This may result in equipment that is needlessly heavy without providing much durability (made from cheap but bulky materials so it can be marketed as "tough"), or equipment that is very flimsy (made to save cost on materials and marketed as "agile" and "sleek"). The nature of the mining is also a big factor - on Earth, miners must deal with moving a lot of earth. In space, you pay for every pound that goes to orbit, but since it costs about the same amount of fuel to go to any part of the asteroid belt, maybe people will favor ultralight mining rigs and beeline for whichever asteroid is the most effortless to mine.
So ultimately there are many factors influencing equipment design on either side. But as a rule, I would expect military equipment to focus more on maneuverability, but also be better protected, especially against active threats such as missiles. Additionally, the military might suppress the manufacture of mining equipment that is particularly combat-worthy, in order to maintain its own monopoly of force. Beyond that, it all depends on the particular military, and the particular mining industry.
what kind of situations and combinations of factors (besides availability: assume both are equally accessible) that can be formulated in science fiction could lead to a case where a character chooses mining tools over weapons in combat?
The obvious reason is that they are a miner and have more experience with mining equipment. It may also be that military equipment is harder to use, perhaps because the users are assumed to have extensive academy training, while mining equipment is simple because the mining companies don't want to spend money on training their staff.
Generally they may be in a unique situation where mining equipment afford a tactical advantage because it is so different from the threats the enemies usually faces, and they are not prepared for it. For example, somebody mentioned the killdozer, which was effective because police don't normally have much anti-armor capability given that most criminals don't use armored vehicles. Of course anti tank weapons could always be easily obtained, but that takes time, thus giving the killdozer the element of surprise. Maybe the action takes place somewhere deep in the atmosphere of Jupiter, where there is rarely any need for military intervention, so military ships are simply not designed to cope with the environmental hazards, whereas mining ships are.
The big problem with this is that if a piece of mining equipment was superior in combat, the military would also use it. More importantly, their enemies would use it, and the military would develop countermeasures. So if you are going to have a mining tool outperform comparable military tools, the reason should be something that is very circumstantial and one time thing, unless you intend for the user to be a brilliant tactician.