The match, which was suspended twice in November, was finally played in Madrid, and River ran out 3-1 winners, clinching a 5-3 aggregate success.
Boca went ahead in the first half thanks to a brilliant Dario Benedetto goal, but Lucas Pratto levelled for an improved River in the second period, ultimately forcing extra time.
After Wilmar Barrios was sent off for a second booking early in the additional period, Juan Quintero's stunning strike put River ahead and Martinez wrapped things up right at the end.
It proved to be a fitting end to the game for the winger, as he looks set to depart, having reportedly impressed MLS champion Atlanta United with his standout performances for River this season.
"I want to inform the fans that in January I will not continue [with the club]," an emotional Martinez told TyC Sports. "It is a very difficult decision for me, but the road continues.
"I think that I gave the fans what they deserve and it is everything that they believed in me. I am going to play the Club World Cup.
"Spending these moments with this club is the most beautiful thing in the world. There are a lot of things that I achieved with this club that I will miss a lot."