The electrification of bus systems is an inevitable trend in sustainable urban development because electric buses do not use fossil fuels and, therefore, do not exacerbate energy shortages. However, because of their limited driving range and the restricted charging station resources, it is crucial to optimize the scheduling and charging plan for electric buses jointly to ensure operational efficiency. This paper studies the electric bus scheduling problem considering charging station resource constraints, including the limited number of chargers and total power output, which are generally simplified in the relevant literature. We first formulate a nonlinear model to optimize vehicle scheduling, charging time, and charging power, to minimize the total system costs, including the usage costs of electric buses and charging costs. Then, a genetic algorithm is developed to solve this model. Finally, the proposed method is demonstrated by using the example of a transit network in Nanjing. Compared with the existing scheme based on an uncontrolled charging strategy, the proposed solution reduces the total system costs and charging costs by 7.34% and 36.51%, respectively. The findings in this paper can provide practical guidance on electric bus scheduling and promote the sustainable development of bus systems.