Here is a simple solution using jq. It assumes that $colors and $fruits contain the JSON values for 'colors' and 'fruits' respectively:
$colors.COLORS | map( {(.[0]|tostring): .[1] } ) | add as $dict
| $fruits
| .FRUITS |= map( (.[2]) |= $dict[tostring] )
The example below shows how to set $coloars and $fruits.
If your jq has INDEX/1, the first line above could be shortened to:
$colors.COLORS | INDEX(.[0]) | map_values(.[1]) as $dict
Explanation
The first line produces a dictionary ($dict), which is then used to make the translation.
Example
Assuming colors.json and fruits.json hold valid JSON values corresponding to the example give in the question, and that program.jq holds the above jq program, the invocation:
jq -n --argfile colors colors.json --argfile fruits fruits.json -f program.jq
yields:
{"FRUITS":[[1,"apple","red"],[2,"banana","yellow"],[3,"orange","orange"],[4,"grenade","red"],[5,"apple","yellow"]]}