Summary: The measuring is done separately for each corpse. Each city only does the decapitating ceremony once, even for multiple corpses.
Source:
The Rambam in הלכות רוצח ושמירת נפש - פרק תשיעי informs us:
י: נִמְצְאוּ מֵתִים רַבִּים זֶה בְּצַד זֶה. מוֹדְדִין מֵחָטְמוֹ שֶׁל כָּל אֶחָד וְאֶחָד מֵהֶן. וְאִם הָיְתָה עִיר אַחַת קְרוֹבָה לְכֻלָּם מְבִיאָה עֶגְלָה אַחַת עַל כֻּלָּן. נִמְצְאוּ זֶה עַל גַּבֵּי זֶה מוֹדְדִין מִן הָעֶלְיוֹן כְּמוֹת שֶׁהֵן מֻנָּחִין:
If multiple corpses are found near each other, we measure [to find the closest city] from the nose of each corpse.
If the same city is found to be closest to all of them, then that city only brings one Egla Arufa - i.e. only does the decapitating the calf ceremony once.
If they are one on top of another, then we measure from the topmost corpse.
(I assume that if some are closer to one city and others to another, then each city only brings one Egla Arufa.)
Note, however, that the Ra'avad argues on the last point (one on top of another) and says it's not clear from the Gemara. He doesn't elaborate.
ההראב"ד: נמצא זה על גבי זה מודדין מן העליון כמות שהן מונחין. א''א זה הפסק אינו מתברר מהגמרא: