The utilization of green energy resources for supplying energy to ships in the marine industry has received increasing attention during the last years, where different green resource combinations and control strategies have been used. This article considers a ferry ship supplied by fuel cells (FCs) and batteries as the main sources of ship's power. Based on the designers' and owners' preferences, different scenarios can be considered for managing the operation of the FCs and batteries in all-electric marine power systems. In this article, while considering different constraints of the system, six operating scenarios for the set of FCs and batteries are proposed. Impacts of each proposed scenario on the optimal daily scheduling of FCs and batteries and operation costs of the ship are calculated using a mixed-integer nonlinear programming model. Model predictive control (MPC) is also applied to consider the deviations from hourly forecast demand. Moreover, since the efficiency of FCs varies for different output powers, the impacts of applying a linear model for FCs' efficiency are compared with the proposed nonlinear model and its related deviations from the optimal operation of the ship are investigated. The proposed model is solved by GAMS software using actual system data and the simulation results are discussed. Finally, detailed real-time hardware-in-the-loop (HiL) simulation outcomes and comparative analysis are presented to confirm the adaptation capability of the proposed strategy.