The issue is similar to the issue in the below link. TFS 2015 vNext Gated Check-in builds are "Waiting for an agent to be requested"?
I have deleted one of the Agent entry from the table tbl_BuildAgent of Project collection database. Now the Gated check in working fine.