Your 36 Command blocks would no doubt work, and that's the approach I would take if my mind hadn't immediately gone to the Objective that minecraft has, "teamkill.<color>" and "killedByTeam.<Color>." The teamkill.blue Objective increments for a player whenever that player kills another player on a team that is blue.
So you could have each color be it's own level, for example:
Aqua = Level 1
Blue = Level 2
Yellow = Level 3
Etc..
Red = Level 6
So you could then set it up to be, if someone kills someone on the Yellow team, you compare that players team, and if it is 3 or Lower, you Level them up, otherwise, you reset everything.
Taking this route, however, it would be much easier to have a Scoreboard named Level, and If the level = 1, put that player on team Aqua, if the level = 3, put that Player on team Yellow, etc.
Hopefully all of that made sense, and if so, hopefully it's helpful.