I would ref it as Detect going first, for 2 reasons.

1. The resource I use says specifically that Detect always goes first, while the description for Fake Out does not say that.
2. Detect is an effect Yanma used on itself, whereas Fake Out requires the foe to get to Yanma first. I tend to ref self-effects as going first before attacks, just because there's no range involved in a self-effect, whereas if a Pokemon is attacking another, it has to reach them first. If that made sense.