If opposite faces are painted in different colours, three red faces will meet at one corner, and three blue faces will meet at the diagonally opposite corner.
The three cubes that are adjacent to these two corner cubes will also be painted in just one colour.
The six cubes at the centre of each face will also be painted in just one colour.
The cube at the very centre will not be painted.
The remaining $12$ cubes will have at least one face painted in each colour
(27 - 2 - 2x3 - 6 - 1 = 12)