You couldn't alternate between the 2 in 3rd gen for sure. I don't know about 2nd gen, but it sounds unlikely, given how the metagame is all about stall; that'd surely be a more popular strategy.
Anyway, Protect is almost always better. There is room for Detect, however, in Doubles competitive. See, Protect strategies are very common in Doubles, and people know this, so they try to lock the opponent out of protecting at all with Imprison. If you're running Detect, there's much less of a chance that the opponent can lock you out of your protecting move.
Outside of that, Protect is just superior, never use Detect. Any Pokemon that can learn TMs learns Protect.