A 40-year-old man has died after collapsing during the half marathon, race organisers have said.