Busses are replaced regularly anyway. An average bus in Germany for example is 8 years old, so 6-7% of all busses are replaced every year. Just buy electric busses when replacing the old ones instead of throwing out perfectly new combustion engine models. That's also more environmentally friendly, as a large part of its lifecycle pollution happens during the construction of a vehicle.
The other question is obviously highly dependent on the city (size, density, geology etc.) and the type of transit you're building (underground vs overground, separate rails vs. tram on streets etc). As a current example Hamburg is building a new subway line that'll go through the entire city (25km, 24 Stations, almost completely underground) is estimated to cost 15 billion €. So, depending on how mucch your city needs it could be anywhere between 10 and 100bn for a subway net. However, the national accounting will benefit 1.28€ for every 1.00€ that's spent, due to savings in travel times, fuel, cost for accidents and road maintenance, freed up real estate in the city etc. according to the calculations.