It looks like Scenario's run under different instruction/rule sets than 'normal' sandbox play. Not being a code writer myself, I can only guess at the reason for this. I have just started the scenario's myself, and found the same thing you did: the trainer does not work in Scenario play mode. Side Note: Trainer works fine in normal single player games, just not with scenarios. Does anyone know of any way to get cheats working for either of these modes? I couldn't even find a way to CoSMOS or ArtMoney to increase gold in scenario mode.
So, it seems pretty unanimous that the trainer doesn't work with scenarios or mods.