The medals are ability points you can get or loose in the Tower Duels. They allow you stand out among the other competitors and test your knowledge. They also pair you with users that are worthy competitors, making the game more challenging.
Also, the medals determine the rank of a user within a team. For this reason, if two users have the same level, the one with the most medals will prevail.
On the other hand, bear in mind that the number of medals you win or lose depend on the number of medals you already have. The more medals you have, the more you can lose, and the fewer medals you have, the fewer you will lose.
The same will happen with the medals you've already won; the more you have, the fewer you will get in the Duel, and the fewer you have, the more you will get as a reward if you win the Duel.