Theres a lot of leeway in how you interpret "Captain Marvel undoes the snap" but I would say while she will be an integral part of achieving whatever form of victory they get, it won't be because she shows up and is just that powerful. That would be really poor writing, to have a character show up in like the 20th movie, with very little prior acknowledgement, and beat the bad guy that defeated all the heroes of the MCU. Just like I think it would be lazy storytelling if they just use time travel to beat Thanos, but like CM time travel will likely play a role but it won't be the deus ex machina for kicking Thanos' butt.
That may not how everything goes, since they are basing it on the comics.
Nebula has to get it. That's your second or third act right there.