No, a glass railing with posts doesn't necessarily have to have a top rail. It's largely a matter of design. Many people prefer a railing without a top rail to maintain a completely unobstructed line of sight.
However, if you choose not to use a top rail, it is especially important to use tempered laminated glass (safety glass) of the correct thickness to ensure that the railing sections are sufficiently stable and can withstand the loads to which they are subjected.

