Persistence of the weaker species in a non-homogeneous competitive system: Exact result through a quantum mechanical analogy