Nobody ever said that different observers have to agree on the energy of a photon (or anything else). The invariant quantity is energy squared minus momentum squared (i.e. rest mass), which is equal to zero whether the photon is red or green. (Edited to add: I see now that userLTK already said as much in a comment.)