For example, I'm carrying an axe with 20% damage bonus. Does that only apply to the axe when it is active, or also to the flame thrower, my primary weapon?
Normally weapon stats only apply when the weapon is active, however there are a few exceptions to this, the pain train being just one example. The wearer gets both of the weapons benefits regardless of whether or not the weapon is active:
Weapons effects which take place without the weapon being active will be followed with "on wearer", like in the above example. These effects will also appear under the "Current on-wearer attributes" header on the character load out page:
Damage increases/decreases are usually weapon-specific, meaning the buff/debuff only applies while that particular weapon is active. Other attributes, such as fire or explosive vulnerability, apply to the character as a whole no matter what the active weapon is.