Tom Riddle is born much later in Voldemort's Children than in the books, in order to make my timeline work out. Thus, Hagrid attended Hogwarts already, and graduated as normal before going on to become the Hogwarts gamekeeper.
In book 7, Ron is able to open the Chamber of Secrets just by remembering the hissing sounds Harry made. Thus, it's probably possible to learn the snake language like any other, even if you weren't born knowing it automatically by magic. Hagrid, who loves all kinds of creatures, would have every motivation to learn animal languages if ze can. Also, considering that Riddle is a Ravenclaw here, ze probably isn't any kind of “Heir of Slytherin”, and probably isn't innately a Parselmouth.