Ángel Hidalgo edged out fellow Spaniard Jon Rahm on the second playoff hole at the Spanish Open in Madrid to win his first European tour event.