if you use remote task service they will not be handled as part of single transaction and thus when rollback happens on the engine side task is already committed. If you need to have them running within single transaction you need to use localTaskService as Demian mentioned. That way all work will be rolled back properly.
HTH