It hapened to me too,

I was Byzantium, and there was an uprising in one of Hungary's territories, which were allied to me, and then I rushed in and defeated the uprising, when the battle ended I got a message which Informed me that i had Liberated the province for my Ally. Now, the next thing to do was to retreat from the province back to my own.

Interestingly enough, there was no army protecting that provice, so I guess, when there is an army present, we can't offer such assistances, as the armies will have to fight, and War would insue.

Now, I would also like to say that even if I did help the hungarians keep that province, it does not seem to have affected the relations with them, and 10 years later they just attacked me and we were at War.

So, for as long as an neighboring ally does not feel thretened they will remain allies, but if that changes, whatever good deeds you have done, they will go to war with you.

At least, it is what I have witnessed up to now, and it was like that with STW too, Althought MTW is lots less erratic in terms of Diplomatic Relations.

In any case, if anyone knows or has witnessed different behavior of the AI I would too like to know about it.