The AI in Civ5 does some really weird things, but they can generally be explained by saying "you're winning, and the AI doesn't want to speed that process up."
Whenever there is a large score delta or a victory is near, the AI will try to keep resources you need away from you at all costs through this sort of political weirdness. This leads to a lot of odd situations, like:
- Denouncements from civs that have been your allies all through history, because you're approaching a win of one type or another
- Making demands of you (ie, free techs) when they're in no position to make demands, and then getting angry when you refuse, even though you outclass them in every way
- Refusing reasonable trade deals, or refusing to renew trade deals that have been in place for hundreds of turns for no reason
The only other thing that can change the AI's mind more severely than this is if they are imminently about to be crushed by your military. They will then propose trade deals that are wildly unfair to them, even if it means that they have no way to recover. For some reason, the AI believes that survival for 10 more turns and then utter annihilation is worth rolling over and giving you free stuff.