That is just your problem. Pain nor Nagato has the speed to even touch Tobi. Pain couldnt even get Kurama while Tobi did it with low difficulty.
For example; Obito telling Madara to fuck off because he has leverage
Their goals didn't align, why would Pain keep Obito around if they had different goals?