No. The ability Mummy only has an in-battle effect. So, if you hit Yamask/Cofagrigus an inherit Mummy in battle, you stick with that ability until the battle is over (unless you have an ability changing move like Skill Swap or Simple Beam). After the battle is done, you will have your original ability that you went into battle with, NOT Mummy.
Hope I helped! :)