Yes
Targets are selected when a spell or ability goes on the stack. Magda’s ability goes on the stack as soon as it’s triggered, i.e. when the target of Lightning Bolt is selected upon casting. Her ability is triggered and on the stack even before the targeted creature can become hexproof. The creature becoming hexproof will not remove Magda’s ability from the stack, nor prevent the targeting which already happened. It just turns the targeted creature into an invalid target.
115.1. Some spells and abilities require their controller to choose one or more targets for them. The targets are object(s) and/or
player(s) the spell or ability will affect. These targets are declared
as part of the process of putting the spell or ability on the stack.
The targets can’t be changed except by another spell or ability that
explicitly says it can do so.
The stack and resolution will look something like one of the below – things can resolve in slightly different orders, but the outcome is basically the same barring other effects:
-
Lightning Bolt is cast and goes on the stack. Magda’s ability triggers and goes on the stack. Hexproof spell/ability is put on the stack. Hexproof resolves. Magda’s ability resolves and creates a treasure. Lightning Bolt fails to resolve with an invalid target.
-
Lightning Bolt is cast and goes on the stack. Magda’s ability triggers and goes on the stack. Magda’s ability resolves and creates a treasure. Hexproof spell/ability is put on the stack. Hexproof resolves. Lightning Bolt fails to resolve with an invalid target.