Of is used where it indicates an element of a set, whereas
in might be used more often where the set is less clear, or is treated as a continuum... but this doesn't seem to be a "hard and fast" rule.
Set of all Aroma cafes:
The Aroma coffee shop in Lod is the best of them all.
Continuum of the whole country:
The Aroma coffee shop in Lod is the best in the country.
And yet, in the following two sentences, the prepositions seem interchangeable.
1947 was the best year of the last century in India.
1947 was the best year in the last century in India.
If there is any small, subtle difference in connotation, it might be that
of draws attention to the year being in a particular century, and
in includes both country and time, more of a continuum... and perhaps I'm looking for a difference that is not there. sigh