It obviously means “she prayed that the godess would give [her sons] what is best for man”. But I can’t make sense of the infinitive τυχεῖν and the finite ἐστί / εἴη. Looking at the adapted sentence, I would want to read it like so:
ὅ τι ἀνθρώπῳ τυχεῖν ἄριστον εἴη
what for man happens to best be
But that means swapping the infinitive and the finite form. The Greek obviously does something different here, but I’m at a loss as to what…
The thing to be noticed is that the infinitive is governed by ἄριστον:
ἄριστον τυχεῖν ἀνθρώπῳ
ἄριστον takes an infinitive and τυχεῖν takes a dative when it means “happens”, all perfectly normal: “best thing to happen to a man”
However, with “get”, this becomes, “best thing to get for a man”, with the dative acting, I guess, as a sentence modifying dative of advantage.
The first seems more normal to me. But it’s possible that this is the joke: She prayed that they would “get” something good, and the goddess interpreted her more literally.
Do you per chance know how to read the original phrasing: εὔχετο … τὴν θεὸν δοῦναι τὸ ἀνθρώπῳ τυχεῖν ἄριστον ἐστί ?
“τὸ ἀνθρώπῳ τυχεῖν ἄριστον” could be the same thing (the adjective governing the infinitive), but then ἐστί is hanging loose. I notice it isn’t accented as an enclitic, which probably means something.
[On pg. 228 of Morwood’s little Oxford Greek Grammar, there is a short and sweet list of 12 key features of Herodotus’ Ionic Greek. This is number 10 on that list.]
τὸ (= ὃ) ἀνθρώπῳ τυχεῖν ἄριστον ἐστί: I understand this as “what’s best for a person to meet with" (or “get, obtain,” as MattK said). The infinitive is epexegetic.