The life cycle of a boiler depends on many different factors, too many to list all of them here, but among them would be:
Age of the boiler.
What material it is made of and how is it designed and built.
Water treatment, blowdown and boiler wash practices, as well as type of fuel and the way it's fired and run on the road.
Layup/storage practices.
Level of operations.
Quality and consistency (or the lack thereof) of maintenance and repair work the boiler has received during it's lifespan.
The cost of a new boiler is primarily determined by the size and complexity of the boiler structure. 6-figures for certain for almost any locomotive boiler built new, and for a large locomotive, 7 digits.
Also, the cost difference between continuing to repair a boiler or to replace it will vary from organization to organization and locomotive to locomotive. Availability of funds, how much repairs cost, how much repair labor costs, how much the locomotive gets used, etc are just a few of the many variables that must be considered when analyzing a given situation.