The upper berth is not shared during the day, so it is the berth to have for sleeping whenever you like or for a long daytime stretch without company. The trade-off is the climb and the reduced headroom, especially in Sleeper and 3A where three berths are stacked in the height of one compartment.
It is allotted to younger passengers by default when a lower berth quota is exhausted, and is the berth preference most likely to be honoured because it is the least requested.
Also written or searched as: upper berth · UB meaning · top berth