But really, if it were to explore The Underground.... Or if there's a 1 way barrier to prevent leaving the way you entered....
Well, for one, there's alternate means. For example, Teleportation.
Or, if the barrier only extends through the already existing part of the mountain, just tunnel through it. Not like other Pokemon like Onix (Which, even if it weren't superior to, it can just turn into.) can't just leave. Some Pokemon may also have dimensional travel abilities.
That aside, while Pokemon do like to battle, Mew tends to not show itself, so it'd probably just hang out, usually staying invisible, maybe pranking the locals. It might show itself to try fighting someone if they were willing. Maybe Papyrus or Undyne. If they end up wanting a rematch, that would fulfill the condition of "having a strong desire to see Mew", so it might be more open to them.
But yeah. If a human SOUL is required to leave, Mew would be kinda stuck if none of the tricks worked, & I'm not sure if it'd resort to murder or such to get its freedom. Or it might try mind control or other trickery.
Still, Mew's "route" probably wouldn't have many long-lasting consequences to The Underground other than maybe some confused civillians & some friendly sparring.
In an actual fight, I'm unsure how things would go.