Hi Mimi
Of course, as in your own native language, many words in English carry more than one meaning. As a foreign language student, however, your best avenue toward success lies in conquering one challenge at a time step by step. Let's turn to the lexicographers at the major publishing houses for the answer that is truly pertinent to your question and example sentence:
envious: feeling resentment over or desire for another's advantages, possessions or attainments.
jealous: feeling resentful and envious of another's advantages, possessions or attainments.
Consequently, in the context of your example sentence, "Though I was jealous/envious, I shook the winner's hand," the adjectives 'jealous' and 'envious' are synonymous, and their interchangeable usage in this instance illustrates a very natural and common construction in English speech and writing—a perfect match!