Change role of indirectly referenced users with Rules
Finally I managed to solve this issue. The Conditional Rules modul is the key:

{ "rules_oktato_hozzaadas_oktato" : {
"LABEL" : "Oktat\u00f3 hozz\u00e1ad\u00e1sa - oktat\u00f3",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "Oktat\u00f3" ],
"REQUIRES" : [ "rules_conditional", "rules" ],
"ON" : { "node_update--course" : { "bundle" : "course" } },
"DO" : [
  { "LOOP" : {
      "USING" : { "list" : [ "node:field-teacher" ] },
      "ITEM" : { "list_teacher" : "List of teachers" },
      "DO" : [
        { "CONDITIONAL" : [
            {
              "IF" : { "entity_has_field" : { "entity" : [ "list-teacher" ], "field" : "field_related-user" } },
              "DO" : [
                { "user_add_role" : {
                    "account" : [ "list-oktato:field-related-user" ],
                    "roles" : { "value" : { "13" : "13" } }
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  }
]
 }
}