If you look at the sentence part "der alten Frau" in isolation, it could indeed be either dative or genitive. But you must also consider the context.
Genitive can occur in two functions in German:
- as a possessive, i.e. to indicate ownership ("das Haus der alten Frau") or belongig/relationship ("der Ehemann der alten Frau")
- as genitive objects for verbs that take a genitive object: "Ich gedachte der alten Frau."
The verb "sagen" can't take a genitive object, so we can rule out the second function (genitive object).
For the first function (possessive), it's a bit more subtle, as the word order can be changed to a less usual one:
- "das Haus der alten Frau" ≅ "der alten Frau Haus"
- "der Ehemann der alten Frau" ≅ "der alten Frau Ehemann"
Note though, that in these inverted forms, the definite article of the "possession" has to be dropped. (Which kinda makes sense also semantically: By first naming the "possessor", we already convey a definite meaning. And as Skobo Do pointed out in their answer, it works the same in English, too.)
So, because "die Wahrheit" has its definite article, "der alten Frau" can't be possessive (the old lady's truth) and the only remaining option is that it's the dative object. (Which corresponds to the indirect object in English: To who the truth is being told (or in this case: not told).)
Which verbs accept which object cases and/or prepositions (and for what meanings/roles of the object) is something that has to be learned or looked up verb by verb. While there is some correlation between cases/prepositions and role semantics, there's no hard and fast rule to determine the correct case regime for arbitrary verbs. (That's how it is for English, too, by the way.)