My rear disc brakes will grab a little then release all together. I had tightened by cable at the brake handle so I loosened it but it still does the same. It is a Trek mechanical disc brake.
On mechanical disk brakes it is pretty common that the caliper is broken: the spring inside it just slipping when enough power applied (yet this power not enough to brake).
It is easy to check it: push the brake lever and look what is released there: the cable from the nut, or the caliper itself jumps back.
Probably you should replace the caliper.
New calipers coming with new pads, so it's a good time to clean up the disk with a good degreaser and maybe a sandpaper to save the new pads from all its garbage.