Hi sorakirei!
Welcome to Carcassonne Central!
With normal monasteries, the wagon behaves as a monk. Thus, in this case, after surrounding the monastery, you score it and decide whether the wagon moves to an adjacent uncompleted unoccupied feature, if any available, or goes back to your supply.
All in all, the wagon is not trapped until the end of the game. It just stays in the monastery until it is completed, like any meeple occupying an uncompleted feature (saving the differences with the abbot.)
You can check the rules at WICA for this case:
http://wikicarpedia.com/index.php/Abbey_and_the_Mayor#3._Scoring_a_feature_4Hope this helps.
Cheers!