You have understood the phrase perfectly: it is another way of saying "If you had asked..."
(My personal opinion is that it is a pointlessly pompous way of saying it; but I didn't get a vote.)
The base idiom is BE to VERB, where BE is the appropriate form of the verb be and VERB is the infinitive form of any verb. It means, approximately, "suppose", in both the senses in which that quirky word is used.
Thus, in the indicative (real) mode it means be supposed or expected to do whatever VERB names. For instance, I am to go to London tomorrow means "I am supposed to go" or "I am expected to go to London tomorrow".
In the irrealis mode, expressed with the past form, it takes the other meaning of suppose, "assume as a hypothesis". If I were to go to London (or, alternatively, Were I to go to London) means "Let us suppose that I go to London" or "If we assume that I go to London".
In your example, the author asks you to "suppose" not something which happened in the present, which would be expressed as "If you were to ask world leaders today", but something which happened in the past, a few hundred years ago. You have to 'backshift' the expression from present to past.
But you can't do that in the ordinary way, by using the ordinary past form of BE, were—because you've already used up that form in the present. The workaround in English for expressing a past irrealis is to employ the appropriate form of HAVE + the past participle of VERB: "If you were to have asked world leaders a few hundred years ago".
Notice that the same workaround is employed in the ordinary, non-pompous way of expressing the same thought: "If you asked world leaders today" is backshifted as "If you had asked world leaders a few hundred years ago".
This looks like a perfect construction, but it's not; it's the past irrealis construction.