"Ancient Gear Engineer's" effect activates at the end of the Damage Step (when monsters destroyed by battle are sent to the Graveyard). If it is destroyed by battle, or removed from the field by a card effect before then, its effect will not activate.