How do you count troops in Shogun when they fall off the tower?
After looking over the rulebook again, I see a potential confusion arising from the use of the words "participating armies", but I think it's resolvable.  In "General Rules for the Battle Tower":


  All battles are fought with the aid of the battle tower. A player
  takes all participating armies (colored cubes of the attacker and
  defender) and throws them into the tower together with all cubes lying
  in the tower tray at the start of the battle. In the process, some of
  these cubes will remain in the tower, and some that were already
  inside the tower will fall out into the tray, thus producing a chance result.


And a little further on in "Battle Results and Consequences":


  To determine the outcome of the battle, players count up the number of
  attacking and defending armies that come out into the tower tray. The
  side with the most armies in the tray wins. Armies not participating
  in the battle are disregarded and remain lying in the tray.


I think it's clear from these paragraphs, taken in combination, that other appropriately coloured cubes, apart
from the ones thrown in, can become part of the "participating armies" and contribute to the outcome of the battle; a "chance result" is the intended outcome.  "Armies not participating in the battle" doesn't mean "cubes that weren't thrown into the tower just now", it just means "cubes of the wrong colours".

As for the green cubes, the rules say:


  If there are no revolt markers in the defender's province, all farmer
  armies in the tower tray count for the defender. (After a battle that
  includes farmers, all green cubes in the tray are returned to the
  farmer supply. If farmers are not involved in the battle, the green
  cubes remain in the tray.)


So if 6 reds and 3 yellows fall out then red is probably going to win the battle, unless a lot of defending green cubes fell out too!  All the yellow and green cubes are returned to their respective supplies, and the same number of red armies also go to their supply.  Any remaining (victorious!) red cubes will be placed in the contested province.