General Motors Co has won dismissal of a class action lawsuit by two employees in Texas who say the top U.S. automaker violated federal law in denying them unpaid time off on religious holy days.

U.S. District Judge Terry Means in Fort Worth, Texas on Wednesday said James Robinson III, a Seventh-day Sabbatarian, and Chris Scruggs, a Messianic Jew, failed to show they could adequately represent a proposed class of every GM employee who could potentially request an unpaid religious day off.

"Determining individual class members would require the court to wade through thousands of leave requests and evaluate ... whether the request was based on religion," Means wrote.

The judge, however, gave the GM workers a chance to file an amended lawsuit that makes more specific claims.

Robert Wiley, the lawyer for the plaintiffs, said on Thursday that he would likely tweak the lawsuit to propose a class of GM workers who were actually denied days off.

“The law is very clear that workers are entitled to religious leave if it’s not going to cost the company anything,” he said.

GM did not immediately return a request for comment.

Robinson and Scruggs, both electricians at the Texas plant, said in the March lawsuit that they had taken off holy days without pay for several years, but that allowance ceased in 2013.

GM failed to see if volunteers were available to cover the men's shifts and the cost of allowing them to take unpaid leave was minimal, according to the lawsuit. The men said they experienced "stress, humiliation, frustration, sadness and embarrassment" and were made to "feel inferior and different because of their beliefs."

The case is Robinson v. General Motors Co, U.S. District Court for the Northern District of Texas, No. 4:15-cv-0158.

(Reporting by Daniel Wiessner in Albany, New York; Editing by Alexia Garamfalvi and Lisa Shumaker)