The way I would run it, it wouldn't have any resistances for the last two and here's why. It has an intelligence of 3 and has no idea that more saves are coming. It's not going to be smart enough to save them. So it's immune to the fire, uses it's first legendary on the acid, then again on the lightning, is immune to poison, then uses it's last resistance on the cold. Unless it gets lucky and saves on one of those 3. That means that the last two will probably be failed and have no resistances left to use.
The spell isn't going to take the Tarrasque out unless it gets lucky and sends it to another plane, but it will do some damage, probably restrain it for a round and blind the beast. That's pretty significant in a fight of that magnitude.