Public transport is considered as one of the most suitable candidates to benefit from autonomous driving technologies. In this research, we develop a mathematical modeling framework to optimize service frequency and vehicle size for automated bus systems, while accounting for both user and operator costs. We explicitly consider travel time stochasticity, time-dependent passenger flows, vehicle capacity limitations (extra waiting time due to denied boarding), and in-vehicle discomfort externalities for both sitting and standing passengers at a microscopic level. We attempt to provide a thorough assessment of the service and cost implications of the deployment of automated buses. Hence, a broad range of experiments are simulated by combining different deployment cases: (i) vehicle technology (human-driven or automated vehicles), (ii) travel time assumptions (deterministic or stochastic travel times), and (iii) crowding externalities (considering or ignoring in-vehicle crowding costs). The model applicability is assessed on two real-world bus corridors in Regensburg (Germany) and Santiago (Chile). Results show that, with crowding externalities, optimal vehicle size is increased at a similar rate for both human-driven and automated bus services, whereas optimal service frequency is increased at a higher rate for automated buses. Thus, under optimal levels of supply, automated vehicles are operated with lower occupancy levels than human-driven vehicles, increasing the quality of service. Besides, the deployment of automated bus systems can significantly alleviate or eliminate denied boardings. The effects of automation on travel time volatility and dwell time regularity are studied. The consideration of stochastic travel times increases optimal frequencies at a higher rate for automated services relative to human-driven vehicles. Interestingly, we find that even though the operator benefits from automation are more pronounced in high-income countries (due to a greater potential for human driving cost savings), the final outcome is counterbalanced by the actual public transport demand level, because large user cost savings from automation are reachable in crowded routes even in situations in which labor costs are lower (as in developing countries).