The American duo both finished on nine-under-par after 72 holes to set up an extra hole at the 18th, and the following exchange produced one of the more unique playoff holes ever played on the PGA Tour.
Castro sent his tee shot into the water before his third out of the rough struck a spectator in the face before landing in a shoe which he had taken off at the side of the green.
He eventually made a five but Hahn successfully two-putted from around 35 feet to claim his second title on the PGA Tour.
Justin Rose finished a shot adrift of the leading pair to end the tournament in third place, which represents his best performance since winning the Hong Kong Open in October.
However, there was disappointment for Paul Casey as he recorded a score of 77 to drop down to 41st place.