I can't find a link to this now, but I have a memory that when Waterford-Rosslare closed it was reported that it was losing €4m a year of which €2.5m was the cost of manual level crossings. It seems a bit high considering there were only 12 crossings of public roads on the route.
Although it's more expensive than automating a crossing, surely the ideal is to build a bridge as it doesn't require signalling adjustments. Although it's not always going to be practical (e.g. the old Bridgetown crossing on Rosslare-Waterford was right in the middle of the village) and is made harder by the fact that crossing-keeper's cottages were often built next to the line.