By looking at the tablets in which it was inscribed, how are we able to read what the melody sounded like?
Well, as with other very old stuff, there's quite a lot of guesswork.
Pretty much nothing was known or said about actual about Babylonian music until around the 1950s-60s, except that they had music. How did we know they actually had music? As usual, because of depictions of people and/or animals using things that look like musical instruments. But also because some remains of musical instruments (about 10-12 of them, harps/lyres).
The German musicologist Curt Sachs (one of the founders of modern organology, the Sachs in the Sachs-Hornbostel system for the classification of musical instruments) tried to make sense out of some notation in the 1920s. He was using statistics to to find patterns in the frequency of symbols, which I think is comparable to the statistical analysis used to try to figure out linguistic stuff. The result of that was not considered musical at all (as in the way the reconstructed music sounded made no sense at all).
In the 1950s-60s, Anne Kilmer started working on some tablets that apparently were of mathematical nature. She found a section that dealt with "strings." It assigns names to numbered strings, and mentions that some notes/strings are placed "behind" (this was interpreted as "some strings are counted backwards"). The progression of numbers was suggested to be the notation for a scale, and these never exceed seven notes (even if there were 9 strings mentioned). Some alternating names/numbers were interpreted as tuning sequences ("a 5th up, a 4th down").
She found some other tablets had the same words she had found, and thought it was no coincidence, that those tablets contained music. Those tablets contain text and numbers that seem to be musical notes.
So, "these are the words, here's a double line to separate things, and here's a section with numbers that tell you the notes." Right, but how do we know exactly what notes those are? How do we tune them? How do we know how long those notes would be? How do we even know how the words sounded like?
There's little available evidence and educated guesses are some times the best we've got. We are pretty lucky to even have tablets with some readable characters, those things are usually in very bad shape and lots of sections can't be read at all. People worked with tablets written in two languages to try to make sense out of things (as in, using some language you barely know to figure out another one you were clueless about). It's complicated.
A lot is assumed: similarities with the Greek tuning system and theory, the usage of a scale not too distant from the modern mainstream European ones. Yes, we know they had string instruments and tuning fifths is super easy with strings (because of physics), but going from there to "it's a diatonic scale like the one in the white keys of a piano" seems a little... speculative. You can get crazy with just fifths/fourths and create very different scales (some ancient Greek tetrachords sound funky to us, not to mention the Shí-èr-lǜ).
How can we be sure they were using a "white keys" scale? We can't, that's just how some folks interpreted things. Of course, they arrived to that conclusion after trying to make sense out of some descriptions of things that seem to be comparable to our scales and the way we think about music.
How can we know how fast things were sung? How do we know how the words sounded like? We can't know, people have made comparisons with later languages and music. The ideas of a bunch of people with different backgrounds have been compounded for decades/centuries.
Kilmer asked musicologists/musicians for some help (she didn't have a musical background), and they saw patterns: "conjunct motion" similar to what we usually find in melodies and sequences of fifths/fourths like the ones we use for tuning (these would be musicians/musicologists born into our musical tradition, with studies in medieval music and Ancient Greek theory). Somebody made replicas of lyres/harps. Kilmer presented her findings and a demonstration, with a guy with experience in Gregorian chant singing. They then recorded these reconstructions, and the rest is history...
Sachs proposal was rejected because it sounded like gibberish, and new interpretations have been kind of accepted because they sound closer to something we could call musical. There seem to be some common things among cultures (some agreement on the consonance/dissonance of some intervals), but there is a huge diversity of musical practices and contradictions/differences even among contemporary people with the same cultural background.
Music archaeology is a thing, and those guys certainly have their work cut out! But I'd like to mention that not every reconstruction of ancient music is made by knowledgeable professionals who devote their lives to figure out the past. Quacks have tried to claim ancient music for their own purposes, that go from "healing and spirituality" to "far-right political ideology." And they just play whatever they fancy and call it ancient.
See:
Duchesne-Guillemin, M. (1984). A Hurrian musical score from Ugarit: the discovery of Mesopotamian music.
Kilmer, A. D. (1960). Two new lists of key numbers for mathematical operations.
Kilmer, A. D. (1998). The musical instruments from ur and ancient mesopotamian music.
Good question! So first of all the tablet in question has two halves: a upper half which is the text of the hymn and a lower half which is notated. Now this notation is not modern staff notation, rather it is a sequence of numbers and intervals named by the string pair(for example, "irbute 2" is an interval named for strings x+y). This is followed by a tuning, i.e. mode, given at the end of the tablet; we know songs were categorized by mode because other cuneiform catalogs list songs according to their mode(as well as by the instrument accompanying them). We can reconstruct what these terms refer to thanks to other extant Babylonian texts on tuning as well as lists of string pairs in other documents such as catalogs and lexical lists. So we basically have a sequence of intervals plus numbers that seem to tell us something about how to play those intervals. So unfortunately it's not entirely clear what the notation is actually saying beyond the very basic melody at best although we can at least establish something about what that would map out to. There are a lot of different theories about what it actually would have sounded like. Hopefully of course further research will help us better understand the meaning of this text.