What I understand about the random oracle game:
The adversary can query the oracle polynomial many times with the same (secret but unknown) key. From the output returned by the oracle, the adversary has to tell whether the oracle has chosen RANDOM or CIPHER (with probability more than .5).
Now, how does that stop adversary from replay attack? Say, the adversary has told the oracle to keep the same key twice. Both the times the adversary queries the with same message. Now, if oracle has chosen RANDOM, both the outputs will be different with very high probability. Whereas, if oracle has chosen CIPHER, both the outputs from oracle will match.
How the safe-guard is given from the trivial attack?
One idea came to my mind: The oracle has an infinitly large memory. Everytime the oracle is queried, it checks if the same input has be supplied previously. If so, it returns an error/ returns a valid output only when the input is not found in its memory. Is this idea meaningful?