Politics is universal. The same kind of problems crop up in almost every country and the same solutions usually work. Pena Nieto is incredibly unpopular in Mexico. His approval ratings are in the tank. If you are him then what better way to boost your ratings than standing up to the one person in Mexico less popular than you are? I don't think Pena Nieto will deliberately insult Trump. But he will make it clear that there is little if anything they agree on and that he isn't going to cave to U.S. demands.
Both have their agendas, and they both get the opportunity in person to size each other up for a continuing dialogue. I do not expect Nieto to publicly agree with Trump, but Trump holds the winning hand if elected to get Mexico and Mexicans either directly or indirectly to pay for the wall. It’s a lot of money at stake for Mexico.
One big problem with your theory. He doesn’t have a choice. He will cave in to Trump, but in any deal that is worth doing, both sides have to gain something. Trump will give him something that will help him, but Trump will be the one who wins big. Remember who wrote The Art of the Deal.