I Am One With The Force
The Force Is With Me
Golden Mushroom rules wrote:
When you defeat a Goblin guarding a Mushroom, the Mushroom is rescued and the Mushroom Token is immediately placed on your Castle standing upright.
According to RAW, you did defeat the goblin so I would say you would rescue the mushroom and place it as you would if you defeated the goblin in battle