It seems like the IF Statement is working correctly since the right of the pipeline is not showing any timing numbers for that section 1. So it appears that it is not being called at least when you took that screenshot.
One possibility is that the variables are NOT removed even if you do not call that section of code any more. The variable will stay in memory until either the program exits, gets over written by a new value or deleted when you remove a module that generates variables. In your case, because DEBUG_VAR is a custom variable they will remain.
I would also use
int i = getVariable("DEBUG_VAR2")
as i is an integer.
But I think your real issue is with
PushButton("Object Recognition", 0, "Train")
The issue is which Object Recognition module are you referring to? Since you have two and they are the same name the system will ALWAYS chose the first once since you specified a count of 0. This happens EVEN when the first module is not being executed since you are accessing the module via the User Interface ... which is not really the recommended way to do this.
So to fix your problem use
PushButton("Object Recognition", 2, "Train")
for your second CScript. This will tell the system that you mean the second OR module.
BUT did you see the "monitor folder" checkbox functionality? If you check that checkbox when you specify the folder to train from within the OR module, it will retrain automatically when new files are added or deleted from that folder. Its MUCH simpler and more efficient to use than causing buttons to be pushed.