The two words are synonyms, as they are nearly the same thing definition-wise (except for the second definition riposte can have, and the fact that retort doesn't have to be a witty, sharp or angry response, only usually is), but this does not mean that they are virtually exactly the same thing semantics-wise.
Semantics is a sub-field within linguistics. It covers the meaning of words, and the meaning of a word isn't always just its stark dictionary definition. It also involves connotations – the subtler distinctions between the dictionary definition/s of a word and the implications that word engenders. Even the best dictionaries can't come close to bringing out all the myriads of nuances connected with almost every word, though nowadays they try to begin to address the problem by adding many example sentences.
So, what does this mean for your case? Well, to repeat, they both mean nearly the same thing definition-wise. But they have different connotations.
Right off the bat, they have a pretty different morphological and phonetic structure to them, which has a neurological effect on a person.
In American English, the "O" in riposte is pronounced as the /oʊ/ diphthong, quite different from the flat /ɔː/ in retort. In British there's the /ɒ/ sound instead of the diphthong in riposte, so the phonetic difference as big as when pronounced American.
But morphology-wise, the words are quite distinguishable. Riposte is a word most recognize as borrowed from French, which is quite evident from the silent "e" at the end. In fact, it is the French word for retort.
Retort is a Latin word, giving it a much more "English" feel to it. The distinguishable etymological origins of the words give them different connotations immediately.
One could argue riposte is a more poetic and beautiful word, though this is subjective, and there have obviously been no studies as to the majority consensus on this, which means it doesn't really count as a connotation. But ask yourself this question, and work off of that.
In usage, according to Collins Dictionary, they are both listed as "Used Occasionally", so there is little to no discernible difference in their popularity.
Lastly, something user Robusto mentioned in his answer, riposte is also the word for a counter-attack in fencing, which adds a lot more depth to the word's thematic and symbolic potential. It also affects the connotations to be had.