Wireless communications and sensing at terahertz (THz) band are increasingly investigated as promising shortrange technologies because of the availability of high operational bandwidth at THz. In order to address the extremely high attenuation at THz, ultra-massive multiple-input multiple-output (UM-MIMO) antenna systems have been proposed for THz communications to compensate propagation losses. However, the cost and power associated with fully digital beamformers of these huge antenna arrays are prohibitive. In this paper, we develop THz hybrid beamformers based on both model-based and modelfree techniques for a new group-of-subarrays (GoSA) UM-MIMO structure. Further, driven by the recent developments to save the spectrum, we propose beamformers for a joint UM-MIMO radar-communications system, wherein the base station serves multi-antenna user equipment (RX), and tracks radar targets by generating multiple beams toward both RX and the targets. We formulate the GoSA beamformer design as an optimization problem to provide a trade-off between the unconstrained communications beamformers and the desired radar beamformers. Additionally, our design also exploits second-order channel statistics so that an infrequent channel feedback from the RX is achieved with less channel overhead. To further decrease the UM-MIMO computational complexity and enhance robustness, we also implement deep learning solutions to the proposed modelbased hybrid beamformers. Numerical experiments demonstrate that both techniques outperform the conventional approaches in terms of spectral efficiency and radar beampatterns, as well as exhibiting less hardware cost and computation time.