When you get across, leave the Goombas behind and use the flower to get up to the next platform.
If you’re feeling gutsy, hop on with the stack of Goombas to reach the Sand Kingdom Purple Coins floating up on the side. When you’re ready, head to the moving platforms and carefully make your way across.
There’s also a giant chain-reaction of coins you can get in the far corner, but it will trigger a never-ending loop of shockwaves that might be a pain to deal with - your call.