Hi, Yes, they are eligible for Gratuity.
They are certainly covered under the Act since they work for the Principal Employer, even if it is under or through a contractor. Such workers are not engaged to do the contractor's own work/job. What is important is for whom the work is done and not by whom they have been hired. As the services are availed by the Principal Employer, they should be eligible for Gratuity.
Mr. Madhu or Umakanthan can provide further clarification on this.