In the sentence
Vamos a preguntarle a las personas
what is the "le" referring to specifically in "preguntarle"? I thought the pronoun refers to the direct object (in this case, the people). So shouldn't it be "les" instead of "le"?
Yes, the pronoun le in the sentence you quote is referring to las personas. Note that it is the indirect object, as guifa's answer explains.
The pronoun should agree in number with the noun, so the preferred form for this sentence is:
Vamos a preguntarles a las personas
According to RAE's DPD, it is quite usual to find disagreement between pronoun and indirect object, even in "educated" speakers. This is discouraged by the Academy:
6. Discordancias en el uso de los clíticos. Son dos las discordancias frecuentes en el uso de los clíticos:
a) A menudo, cuando el pronombre átono de dativo concurre en la oración con el complemento indirecto preposicional, se utiliza el singular le, aunque el referente sea plural; esta discordancia está extendida tanto en España como en América, incluso entre hablantes cultos, por lo que son frecuentes, aunque normativamente desaconsejables, oraciones como ❌«Colombia le propuso a los Gobiernos de Estados Unidos y Venezuela una alianza» (Tiempo [Col.] 18.4.97). En el uso esmerado se recomienda mantener la concordancia de número entre el pronombre átono y el sustantivo al que se refiere: «Los mismos remedios de distracción que les daba a sus enfermos» (GaMárquez Amor [Col. 1985]).
preguntar is a verb that can take a direct object (the thing being asked) and an indirect object (the thing to whom the direct object is posed).
Las personas is an indirect object, and so its equivalent unstressed pronoun is les. It could just be a typo for a missed -s.
But there is no requirement that both le(s) and las personas appear together (if las personas were a personal pronoun, however, we would need both to appear). If we consider le not to be a typo for les, then there is nothing for the le to refer to. It could, however, then be a typo for lo or la:
¿Sabes quién es aquel hombre?
— No sé, vamos a preguntarlo a las personas aquí. (preguntar ello a ellas)¿Sabes la edad mínima para poder ver esta película?
— No sé, vamos a preguntarla a las personas aquí. (preguntar la edad a ellas)
P1 preguntarle a las personas
Spanish was not my first language, and I think I know what you're asking. I don't think you're asking why it's le instead of les in Phrase 1, and anyway, others have done a great job of addressing that. I think you want to know why it's not just
P2 preguntar a las personas
without the pronoun.
First, let's imagine a situation: Let's say my son asks me what day his aunt will be leaving to go back to where she lives, and I don't know the answer. I might tell him to ask her: "Pregúntale." Or: "No sé. ¿Por qué no le preguntas?" In this situation, there's no question who "le" refers to -- it's his aunt. It's clear from the context.
Now let's imagine my son asks me what day his aunt and uncle are leaving. If I say, "Pregúntale," the child might wonder which person he should ask. Let's say I happen to know that in that couple, it's usually the wife who keeps track of things like plane tickets. Then I'll say, "Pregúntale a tu tía." It feels good to start with "Pregúntale," because... well, because there's a natural tendency to want to use a pronoun whenever possible. But I add "a tu tía" for more clarity.
Optionally, one could skip the pronoun and say, "Pregunta a tu tía," or "Ve a preguntar a tu tía," but it feels a bit more brusque and I think it's slightly less common.
(That actually turned out to be a bit of a "just because" answer. Maybe someone else will come up with more of a reason.)
Edit: Sigh. I just reread the question found I was way off base....