Q:

Regent and Viceroy: When should I use one over the other?

These words appear to be synonymous, so I checked to see the difference on Wikidiff which gives the following definitions:
One who governs a country, province, or colony as the representative of a monarch.
One who rules in place of the monarch, especially because the monarch is too young, absent, or disabled.
I also checked thesaurus.plus which uses the same definition for each and also notes the following:

Viceroy and regent are semantically related. in director topic. In some cases you can use "Viceroy" instead a noun "Regent"

Despite that, I did not see a clear difference. What exactly is the overlap? Where is the difference? When would you use one over the other?

A:

The difference, using the words from your research, is between ruling in place of (i.e. instead of) the monarch (regent) and ruling as a representative of the monarch for part of their land (viceroy).
Let's take the UK and India as an example. They're both countries, they have the same monarch, who resides in the UK. If the monarch rules in the UK, and assigns someone to rule India, then the ruler of India is a viceroy. For example, Louis Mountbatten was Viceroy of India while George Vi was King of the UK and Commonwealth (though the Prime Minister Clement Attlee held the true power in the UK).
If, however, someone was ruling the UK for the monarch, and the monarch wasn't ruling anything at all, then they'd be a regent. For example, in the later years of King George III's rule his insanity meant that no-one wanted him to rule, so his son became Prince Regent, with all the power of the king. (Later when George III died his son ceased to be regent and became king in his own right, George IV).

