Viscosity approximation methods for hierarchical optimization problems in CAT(0) spaces