Well, that is an interesting question. The word "them" does refer to the apostles who were speaking. But, was the miracle that the spirit poured forth only causing the apostles to speak in different languages? Or, was it only causing the people to hear in their own language what the apostles said?
Further evidence is available in the succeeding verses of Acts 2:7-11,
"and they were all amazed, and did wonder, saying one unto another, `Lo, are not all these who are speaking Galileans?
8 and how do we hear, each in our proper dialect, in which we were born?
9 Parthians, and Medes, and Elamites, and those dwelling in Mesopotamia, in Judea also, and Cappadocia, Pontus, and Asia,
10 Phrygia also, and Pamphylia, Egypt, and the parts of Libya, that [are] along Cyrene, and the strangers of Rome, both Jews and proselytes,
11 Cretes and Arabians, we did hear them speaking in our tongues the great things of God.' (YLT)
The context of all of the verses makes it clear that the devout Jews standing next to, or near each other recognized that those around them who were of different nations understood what the apostles were saying even though their companions were of different languages and dialects.
It seems evident that they were hearing their own dialects / languages no matter what language the apostles spoke. Peter was standing with the eleven (vs. 14) and the text lists at least 14 countries / areas in the audience. The twelve had to cover all of the languages present.
The RSV has vs 6-11,
" 6 And at this sound the multitude came together, and they were bewildered, because each one heard them speaking in his own language. 7 And they were amazed and wondered, saying, “Are not all these who are speaking Galileans? 8 And how is it that we hear, each of us in his own native language? 9 Par′thians and Medes and E′lamites and residents of Mesopota′mia, Judea and Cappado′cia, Pontus and Asia, 10 Phryg′ia and Pamphyl′ia, Egypt and the parts of Libya belonging to Cyre′ne, and visitors from Rome, both Jews and proselytes, 11 Cretans and Arabians, we hear them telling in our own tongues the mighty works of God.”
Imagine if the miracle was only that the Apostles spoke in different dialects. If that were the case, then those of the audience would be able to hear all of the apostles as each spoke in different languages. It would be a cross talk situation, with each listener trying to filter out only his own language / dialect.
It is probably best to allow the full miraculous power of the Holy Spirit to do both: a) to allow the apostles to speak in foreign languages, and b) to allow the listeners to hear in their own language / dialect.
The end result of this miracle is the direct witness that would be spread throughout all of those lands by the people who returned home to tell of what they saw and heard on that special Pentecost. It aided the spread of the gospel throughout the lands, and established that the apostles were filled with the Holy Spirit, and had authority from God to be His messengers for the gospel of Christ.