If an execution is removed, i.e. a task is canceled by a boundary event, the local variables are cleared before the tasks removed (see ExecutionEntity). As task listeners rely on the consistent state of the execution the variables should still be available while the tasks are deleted.
At the moment the behavior of canceling an execution and a whole process instance differs in this regard. In the later case the variables are still accessible. Both cases should behave the same.