The article specifically mentions that the weight loss was not enough to explain the effect on the migraine:
"Importantly, while participants’ body mass index declined slightly (from 34.01 to 33.65), this change was not statistically significant. An analysis of covariance confirmed that BMI reduction had no effect on headache frequency, strengthening the hypothesis that pressure modulation, not weight loss, drives the benefit."