Well, whoever it was seems to have had the power to freeze them all. If they're actually the same giants that we saw in Punk Hazard in Chapter 660.
I suppose it could have been someone who had Aokiji's Ice Fruit in the past. But, this particular ice seems to have been frozen even before Punk Hazard was turned into a ice island. So, it's REALLY long lasting ice. The Ice Fruit may be capable of something like that, but I'm leaning towards it coming from a different source.
I've been thinking that maybe Pluton could have some sort of "ice beam", for various reasons. But, that wouldn't quite make sense, since the Galilea Giants should have been active AFTER Pluton got sealed away under Wano. So, it's probably not Pluton directly. But, maybe the Giants had part of Pluton's weapons built for their own ship, and it backfired, freezing them all with the weapon that they themselves built, ironically. Maybe they even chose to freeze themselves. If they too wanted to see the return of Joyboy/Nika, maybe they froze themselves so they could still be around for the Dawn of the World? Or to avoid getting captured by the World Government?
I guess maybe V Nusjuro could have possibly frozen them, with his ice-themed powers. And the World Government DID take control of the island that would become Punk Hazard. But, it's weird that the World Govenment just left them there, if they already knew they were there. I have a feeling the World Government didn't know they were there. We don't know for sure. But, it's just a hunch. Maybe V Nusjuro was keeping these guys a secret, just like how Saturn was keeping Emet a secret from the World Government. But, I'm not sure if V Nusjuro would bother with something like that or not.
So, that leaves me with the last option that I can think of. Which I think could be the most likely. I think the Galilea Giants were trying to reach the Underworld Mining Operation of the First World. The place where the Forbidden Sun used to be. Only, the core of the planet is frozen now, so they got frozen in their attempt to reach the core of the planet. Brook and V Nusjuro's powers have been hinting that the "Underworld" in the One Piece World is frozen. And if you removed a "Sun" from the core of the planet, it would cool down quickly and likely become "frozen". We've seen that Ancient Giants are weak to the cold in the first place, since we saw that Oars was frozen to keep him under control on Thriller Bark. Plus, it would make sense that these guys would be interested in the hyper-advanced ancient technology that might be down there. This would give us a link to another future plot point, since the Strawhats are likely to journey down there themselves in the future. So, I feel like the Galilea Giants tried to pull a Orpheus, and it backfired on them.
So, it was less "someone" who did this to them. And more like trying to go to a place with a VERY inhospitable climate, especially for their race. They probably didn't prepare properly for how cold the center of the planet is, rushing headlong into adventure.
But, there are a few other options that could be the case. But, whatever happened, it probably involved ice, somehow.