Bendigo was where the gold was.
Not really true.
Right from when they were founded in the latter part of 1851, Ballarat and Bendigo have both have been very similar towns of the same size and of similar massive wealth competing to be THE premier goldfield town. In a way, that continues right through to today, both have around 100,000 people and both continue to compete with each other.
The only real differences were climate (cool and wet v. warm and dryer) and the type of gold found in each town. After the initial rushes for near surface alluvial gold, Bendigo specialised in reef mining where companies built shafts thousands of feet deep to access rich gold reefs far below the ground, while Ballarat specialised in "deep leads" which were essentially gold rich creek beds which had been buried by volcanic activity which stopped as recently as 10,000 years ago. At Ballarat small syndicates of around 4 men spent at least 6 months digging through the volcanic rock to where they thought the buried gold bearing creek would be. If they were right, they would be rich. If they were wrong, they had wasted a years work and would be broke. So by 1862 Bendigo was the home of big company mining where miners had a secure wage, while Ballarat's mining was a hit or miss affair where partnerships were the major type of mining.
But I digress. The railway arrived at both cities in 1862 and it is impossible to rate one as having more gold than the other, although their economies operated in quite different ways. As gold mining was starting to be less profitable in both cities, the cheaper prices that rail transport brought allowed smaller, more marginal mines to continue operating.