Concepts of "winning" and "losing" become rather problematic when we think of this brilliant story. Of course, strictly speaking, the lawyer has lost the bet, as he chooses deliberately to break the terms five minutes before he would actually win the bet, as the note tells the banker. This means that based on the conditions that they agreed upon, the banker actually wins the bet.
However, when we think of the lawyer's note and what he has actually learned through his time of enforced solitude and the way that the banker responds to that note, perhaps we can actually argue that it is the lawyer who has won, as he gains an understanding and an appreciation of man's vanity that the banker responds to emotively. Consider how the banker reacts after reading the letter of the lawyer:
When the banker had read this, he laid the page on the table, kissed the strange man on the head, and went out of the lodge, weeping. At no other time, even when he had lost heavily on the Stock Exchange, had he felt so great a contempt for himself.
The truth spoken in the letter of the lawyer where he exposes the actions and purpose of humans indicates that, although the lawyer in theory lost the bet, he gained something of far greater value than mere money through his time alone. The response of the banker to reading the note strongly suggests that he is aware of just how much the lawyer has gained, and his tears indicate that he is the actual loser of this "bet."