There is no Pokemon center to heal your Pokemon at, so how do your Pokemon get healed? (I've never lost my first rival battle)
When you lose your first rival battle, you actually don't black out. Your Pokemon are automatically healed (or healed by the onlooker, who is usually an accomplice), and prize money isn't paid. It's basically like a tutorial battle for beginners, just to have them get a hold of the concept.
Hope I helped!
There are Rivals that you lose to them and don't Black Out in the first battle. One exception is May/Brendan in RSE.