Can I still create a sand soldier token using my Azir Legend even though the text says "played" a gear, if I play a gear and my opponent banishes it with Ravenbloom Prefect?
Yes. The gear was fully played and resolved — Ravenbloom Prefect's "When an opponent plays a gear" trigger only fires after the act of playing has completed (Rule 419.4.a), and then it banishes the gear from the board. Banishing it afterwards doesn't retroactively undo that it was played.
Azir's condition ("Use only if you've played an Equipment this turn") is a non-triggered check that looks back at whether an Equipment was finalized this turn (Rule 419.4.b) — and once satisfied, it stays satisfied regardless of where that gear ended up. The only thing that would stop it from counting is the play itself being countered (e.g., Defy). Just remember to activate Azir when the chain is fully resolved and the game state is Open again.