It doesn't matter how thick the whole mattress is, because the surface of the mattress does not have any thickness at all. That is the whole point of the analogy. Forget about the 3D object and just focus on the 2D aspect of it's surface.
The mattress appears to be flat (overall) while the balloon is curved. But these are not incompatible. If you could zoom into a region of the surface, it would appear to be flat like the surface of the mattress. Zoom back out, and you can see that while appearing flat on small scales, the overall surface is in fact curved.