Water heater service cost comes down to the part involved and the amount of working space available. A thermostat replacement is generally easier in an open, accessible location than in a tight closet where additional access work is required. Routine maintenance and flushing are generally more predictable expenses and can help identify or reduce some problems before they lead to larger repairs.
Water heater installation pricing reflects the whole scope: removal and disposal, permitting, installation of the pan and drain line where required, applicable code requirements such as seismic strapping and thermal-expansion control, and the labor involved in moving equipment through finished spaces. In attached housing, add protection for shared hallways and stairwells. Every one of those items appears on the estimate before we start.