Hanuman with his immense strength could have destroyed Vaali easily. But he was a mute spectator to the tussle between the brothers.
This might be because Hanuman was not a king and couldn't therefore challenge Vaali who was a king.
Later, in Uttara Kandam, Rama discusses this with the sages.
Shri Rama: When Vali and Sugriv became enemy of each other; then as forest fire destroys trees, why did Hanuman not destroy Vali in the same way? This is difficult to understand. I believe that Hanuman did not remember his strength at that time. That is why, he was left just to see his beloved Sugriv suffering in such a situation.
Shri Agastya: O' Shri Rama! Whatever you say about Hanuman is all true. There is no match to Hanuman in strength, intelligence and speed. O' destroyer of enemy, Shri Rama! Sages, whose curses are never vague, had cursed Hanuman that despite having the strength; he would be forgetful of the same.