Members of a conference of some of the largest railroad operators in the US are to begin offering health benefits to same-sex spouses as of January.

The National Railway Labor Conference, which represents CSX, Norfolk Southern Corp, Union Pacific Corp and BNSF Railway Co, represents the railroads on labour groups, state and federal government officials and in the courts.

The conference released a statement saying: “While this it is not a benefit required by law or under current collective bargaining agreements, the railroads agreed with labor to provide the benefit in light of recent changes allowing same sex couples to access same federal tax benefits provided to other married couples.”

Two BNSF engineers previously sued the company as they were legally married in Washington state, yet the company had refused to provide benefits. The lawsuit said the railroad violated the federal Equal Pay Act.

“It shouldn’t take a federal lawsuit to make a national company do the right thing,” attorney Cleveland Stockmeyer, which represents the couples, told the Associated Press. “If they tell me or my clients the benefits will be offered, and if they actually do it, we’ll believe it. But they still need to account for denying them benefits for one year.”