The maximal operator in weighted variable spaces on metric measure spaces