The electrification of bus systems offers the potential to reduce fossil fuel consumption. Motivated by this, we assume a scenario in which a single existing bus route is operated by battery-electric buses and find the optimal planning by determining the number of chargers, the electric bus fleet size, and the battery capacity. While decision-making, it is necessary to guarantee that all scheduled tasks are completed with reliability against stochastic electricity consumption. We discover that a large fleet size and a high charging infrastructure capacity can reduce the minimum necessary battery capacity, and this tradeoff is crucial in the optimization. We demonstrate the proposed framework using electric bus operation data collected in Jeju, Korea, and find that the optimal electrification of a bus route can be economically and environmentally beneficial.