What's happening here is that you are dying after you defeat the first member of the elite four, which halves your total money. Since you weren't checking your money between defeating the first member and losing to the second member, it appeared that you were getting half as much money as you really were, since you immediately lose half of all the money you get.
It's very nearly impossible to get caught in a never-ending loop, due to the move Struggle, which is the move your Pokemon uses when it can't use any other move.
You can still win this battle, but it will take some planning:
There are a few things that can happen here.
Firstly, if you have Ether or Elixir (or the Max Ether/Elixir), you can restore some of the PP of the attacking move mid-battle, allowing you to continue using your attack. If you don't have Ether or Elixir, you will continue to use up the PP of your non-damaging moves until one of two things happen:
- You completely run out of PP, resorting to Struggle, and losing 1/2 your damage dealt in recoil per turn
- The Magikarp runs out of PP, also resorting to Struggle, and also losing 1/2 damage dealt in recoil per turn.
Splash has a maximum 40 PP. Minus the moves you've both already used, if you can survive using your other non-damaging moves long enough, it will be the Magikarp that Struggle's itself into fainting, not you.
Of course, even if your other moves don't have enough PP, you have a trump card. That Silcoon you said was useless? Switch to it. Then switch back. And switch again and so on. Switching counts as a move, and that Magikarp will just keep Splashing away while you don't use any PP. Do this for long enough and the Magikarp will start Struggling, hurting itself more than you, and eventually fainting.
Is it cheesy? Yes. Will it take forever? Yes. But either way, someone's gonna have to Struggle themselves into fainting, and it may as well not be you.
Best Answer
If you did the maths and even an endless series of lucky critical hits would not be enough, there really isn't anything more you can do for that sort of situation. You would indeed be stuck in an endless loop. There is no AI programming that makes the opponent forfeit, nor are there usually ways of forfeiting the battle yourself without resetting the game. Your situation was very unfortunate and almost never happens. I've been playing Pokemon games for years and have never been stuck in a battle I couldn't win OR lose.
In the case of the opponent placing you into a situation where you cannot defeat them by battle, there are a few ways to eventually take them down indirectly. Such as:
These solutions assume you have the Pokemon to pull them off. It could not help the situation you described but they could be cautionary means of reducing the chances of it happening again.