Fossil-fueled generators and electrical grid extensions are the most popular energy sources for supplying electricity to rural areas. However, the high cost of running and maintenance, noise pollution, and a need for decarbonization necessitate the hybridization of different energy sources as a viable solution. Using the conventional technique for the optimal design of a Hybrid Power System (HPS), such as the Hybrid of Multiple Energy Resources (HOMER), is inefficient regarding electricity cost and carbon emission reduction. Hence, this research conducted a technical and economic analysis of an optimal photovoltaic (PV), battery, and diesel generator-based power system to electrify Ibudo Ora, a rural community in Ogbomoso. A feasibility study on electricity demand was conducted on the Ibudo Ora community by conducting an onsite survey, and the community load profile was estimated. Mathematical modeling of the HPS component was formulated. A multi-objective function was developed to minimize the Net Present Cost (NPC), Levelized Cost of Electricity (LCOE), and Total Carbon Emission (TCE) and maximize the System Reliability (SR) of the proposed HPS and optimized using the Energy Valley Optimizer (EVO). MATLAB R2021a was used to simulate the developed model. The performance of the developed EVO-based HPS was evaluated using NPC, LCOE, TCE, and SR as metrics and compared with HOMER, which was used for the same purpose. The NPC of the developed EVO-based HPS and HOMER-based HPS were $998702.87 and $1011984.27, respectively, while the LCOE were $0.4889 and $0.4954. The loss of power supply probabilities of the developed EVO-based and HOMER-based HPS was zero, while in terms of TCE, EVO-based HPS and HOMER-based HPS had 775958.15 kg and 832912.49 kg, respectively. The results showed an appreciable reduction in the NPC, LCOE, and TCE using EVO compared with HOMER for an optimized HPS. This research will assist the government, investors, and policymakers in making decisions on rural electrification using HPS.