Your problem is you have declared local variable arguments clk and mask as inputs. That means their value gets copied from the actual arguments inside the module at time 0 to the local formal arguments when the task gets called, and they never change again.
You want to use ref arguments instead of inputs. That creates a reference to the actual arguments instead of another set of local arguments inside the task. Then whenever the actual arguments change, the task will see the reference change.
task automatic chk( ref bit clk, mask);
Tasks/functions are required to have automatic lifetimes in order to have ref arguments.