The hiccup reflex has no established function in adult humans. Evolutionary explanations are therefore hypotheses about the origin of the reflex, not descriptions of what it currently does.
The amphibian breathing hypothesis
Amphibians and lungfish ventilate their gills with a two-phase motor pattern: a phase of aspiration with the glottis closed, then a phase of expulsion with the glottis open. The aspiration phase is produced by muscles that are homologous to the muscles the hiccup uses, and the glottic closure matches the hiccup's second mechanical component. The hypothesis holds that the brainstem pattern generator for this pattern was retained in mammals, where it now drives the diaphragm. The hiccup is the vestige: the same motor program, running on mammalian hardware, with no gills to ventilate.
The suckling hypothesis
Infants hiccup far more often than adults, and the reflex is present before birth. One proposal is that hiccups help clear swallowed air from the stomach during feeding, since the diaphragm contraction changes intrathoracic and intra-abdominal pressure while the glottis closes. A related proposal is that the hiccup helps entrain the suck-swallow-breathe rhythm, or that it exercises the neural circuitry that will later generate breathing. On this view the reflex is a developmental program that becomes vestigial after infancy rather than a gill remnant.
The two hypotheses are not mutually exclusive. A brainstem pattern generator can be inherited from an amphibian ancestor and also be recruited during infancy for a suckling-related function. Evaluating them means asking what evidence each predicts and whether that evidence is present.