I agree that they could die of grief, like dogs do sometimes. They could also die out of starvation in their Pokéballs, but I doubt that. You know why?
You can deposit your Pokémon to PC boxes and leave then there, but they never starve away. In the anime, all Ash's and Gary's Pokémon go to Oak's lab, but that can't be the case with every trainer. Besides, when Ash really does catch all the 493 Pokémon - legendaries, is Oak still going to take care of them all? Feed them every day? Who pays for all that food? I would assume the 30 Tauros consume an awful amount of food, too.
My theory is that the Pokéball somehow keeps its inhabitant nurtured as long as it's in the ball. Maybe with some energy or something, I don't know. Maybe all the Pokéballs have tiny nuclear reactors in them so that they never run out of batteries. Or maybe they use some solution based on quantum mechanics so that the energy appears to come from thin air, but it actually is produced in the ball in some way. Or then the red-foggy-light form of Pokémon does not consume energy.
But if this was indeed the case, and the trainer died in some remote place, his Pokémon would be doomed to spend the rest of eternity in their balls. I mean, how could the ball know the trainer has died? It would be far too complicated to make the ball somehow monitor the trainer's vital signs. Well, unless there's a PETA in Pokémon world and they've forced the politicians to do a law that prohibits Pokéballs without TVSD, Trainer Vital Sign Detector.
I dunno, really. But it's an interesting question.
I think some people over think things sometimes.
What do you think happens to a trainer's Pokemon after the trainer dies, provided that the Pokemon still live?
I always figured that if the Pokemon got over the grief of loosing their trainer, that they would be free again, unless they where at the professes lab or something. Maybe the Person who get all of the trainers stuff, (closest living relative) gets to decide what to do with them.