Digimon, hands down for story. Pokemon is extremely successful but that's because they have a better foot in the door for the game industry, whereas Digimon has next to none. If you were to ask me if I wanted to play Pokemon, or play a Digimon game, I'd go for Pokemon. But in terms of actual quality of the story that the anime's tell? Digimon has it, hands down with no contest. The characters grow and develop throughout every series far more than any pokemon episode, where it's just the next Blunder with Ash and the iconic monsters. Digimon, you have one tamer (or chosen child,) and their partner. It's developing that bond and friendship to face the overall evil trying to destroy the world. It's far more personal and gives way more investment to the characters and digimon.
In my opinion, the two genres are so vastly different they shouldn't compete however. Pokemon is good in its own right for the gameplay. Digimon is great for the story of its anime. Pokemon is about trying to catch and tame all the monsters, digimon is about the personal bond between Digimon and their partner. Both just tried for two entirely different things.