People are forgetting that Gladio's problems didn't end with the hostile exchange between Noctis and him in the train. All throughout the trek through Fodina Caestino, Gladio is extremely belligerent without any provocation. Noctis turns on the generator and is then insulted by Gladio for not turning it on fast enough. Gladio starts yelling at Noctis about doing his duties in the middle of a search for the royal tomb. Noctis gave him absolutely no reason to believe that he wasn't working hard to do what they came there to do (this is a good bit of time after the train where Noctis was moping).
Gladio was harmless up until this chapter to me. After it, it made him my least favorite of this game's party members without question. I wondered why Noctis even considered him a friend, to be honest.
As has been stated multiple times, they were pissed at each other, with only Ignis holding the group together. Not to mention they just had an intense shouting match just hours prior. By the time you return to the train, they start patching things up thanks to Ignis laying down the hammer.