Hi thanks for your question.
drinks are carbonated which means they contain carbon dioxide (co2) which released in the stomach.In the stomach co2 distends the stomach The distended stomach along with co2causes reflux of gastic content into stomach if lower esophageal sphinter is loose.Co2 also causes gastritis
.Gastritis with reflux esophagitis
causes pain in stomach and esophagus
.Pain immediately after taking cold drinks could be due to sudden distension of stomach due to co2 and reflux of gastric content into esophagus .To avoid this problem in feature always take cold drink slowly.
Hope this answers your question.