This paper investigates the application of physics-informed neural networks (PINNs) to solve free-surface flow problems governed by the two-dimensional shallow water equations (SWEs). Two types of PINNs are developed and analysed: a physics-informed fully connected neural network (PIFCN) and a physics-informed convolutional neural network (PICN). The PINNs eliminate the need for labelled data for training by employing the SWEs, initial and boundary conditions as components of the loss function to be minimized. Solutions obtained by both PINNs are compared against those delivered by a finite volume (FV) solver for two idealized problems admitting analytical solutions, and one real-world flood event. The results of these tests show that the prediction accuracy and computation time (i.e., training time) of both PINNs may be less affected by the resolution of the domain discretization than the FV model. Overall, the PICN shows a better trade-off between computational speed and accuracy than the PIFCN. Also, our results for the two idealized problems indicated that PICN and PIFCN can provide more accurate predictions than the FV model, while the FV simulation with coarse resolution (e.g., 5 m and 10 m) outperformed PICN and PIFCN in terms of the speed-accuracy trade-off. Results from the real-world test showed the finely resolved (10 m resolution) FV simulation generally provided the most accurate approximations at flooding peaks. However, both PINNs showed better speed-accuracy trade-off than the FV model in terms of predicting the temporal distribution of water depth, while FV models outperformed the PINNs in their predictions of discharge.