My guess is that the cast effect would go on the stack & resolve prior to Ulamog being on the field and in play as a legal target for Path, but I'd like some confirmation to be certain.
You can exile your opponents' Plains before Ulamog resolves, but you can't stop your opponent from getting mana from them. Assuming no one has anything else to do besides the things you mentioned, it'd go like this:
- You cast Ulamog.
- Ulamog's "when you cast..." ability triggers, and you target your opponents' two Plains.
- Your opponent taps both Plains for white mana, leaving it in their mana pool. (They float two white.)
- The triggered ability resolves, exiling both Plains.
- Ulamog resolves, entering the battlefield.
- Your opponent spends one of the white mana to cast Path to Exile.
From your question it sounds like you might be thinking of lands and mana as being the same thing, but as that sequence of events pretty clearly shows, the lands are separate from the mana they produce.
No, you cannot prevent your opponent from tapping their Plains for mana.
Specifically, the play you describe plays out in the following sequence of events:
- You cast Ulamog, the Ceaseless Hunger. It goes on the stack.
- The spell's triggered ability triggers, and goes on the stack on top of Ulamog.
- Now you have a chance to respond. From your description, you probably do nothing.
- Now your opponent has a chance to respond. They tap their two Plains, and if they're planning to cast Path to Exile, they probably don't do anything else.
- The triggered ability resolves, and the Plains are exiled.
- If nobody has a response at this time, Ulamog resolves.
- Now you have priority, but if you choose to do nothing, or you cast a spell or activate an ability, your opponent has the chance to cast Path to Exile targeting Ulamog.