I'm pretty sure they both said they were 25 at some point because that is the age they have listed on the Bulbapedia. I also know Jessie said she was 17 (but that was in the 90s I think.)
There's age inconsistency in the Pokemon anime. On one hand, they want the characters to be relevant to the target audience, so Ash will always stay around 10-13. The rest of the Pokemon world has aged, in a short before one of the full-length movies they were celebrating the one year anniversary of Ash and Pikachu's first meeting, yet Ash is still considered around 10 all these years later. At the same time, technology has progressed, characters have mentioned multiple times that "it's been awhile" when remeeting Ash&co after a couple dozen episodes (or they've at least implied that it's been awhile.)
So, anyway, my guess is that in the beginning of the series they were supposed to be around 17 to make them more relevant to the audience, even mentioning that Jessie was 17 once. But after awhile they probably decided to age them or add enough character background and development to imply that they are much older than 17, at least 25.
Referring to Ash&Co as "twerps" and "brats" and "kids" when Cilan/Brock are at least 15 also seems to hint that they are significantly older.
In the movie "Revelation Lugia" (Japanese version of Pokemon 2000: The Power of One), James said that they were 5 years older than Ash. Also, since no one ever ages in the anime, I would say that Jessie and James are 15 years old.
So according to Bulbapedia, they have been 25 as of M02 (Pokemon 2000.) So perhaps they said 15 not 5, or maybe you were watching a bad sub? Or maybe they changed it to 15 in the English version, I have no idea.