The Prison Service has obtained a court injunction in an attempt to stop warders refusing to work overtime.
Officers in Birmingham wanted to work proper hours, the union says
Up to 20 prison officers at Winson Green jail in Birmingham were involved in a row over overtime payments.
The Prison Officers Association (POA) said officers there were told to do more hours because of a staff shortage.
The Prison Service has obtained a High Court injunction ordering unions to remove a circular which advised members not to work outside their shifts.
The injunction will stay in place until a full court hearing next Friday.
The POA chairman, Colin Moses, criticised the government for taking legal action.
He said: "We are looking after the most difficult people in society and the prison population has increased massively since Labour came to power.
"But we seem to have fewer rights than the prisoners.
"Our members are right to refuse not to work outside their shifts because prisons are being run without the proper number of staff."
Mr Moses added that officers were not refusing to guard inmates on suicide watch, but merely wanted to do their proper hours.
He also claimed the Prison Service had made a submission to the industry's pay review body recommending that officers did not get a pay rise in the coming year.
The Prison Service said in a statement: "The Prison Officers Association has been ordered not to encourage their members to break their contract of employment and/or take part in industrial action in the form of withdrawing from performing work covered by ex-gratia payments."
Juliet Lyon, director of the Prison Reform Trust, said: "It's difficult to think of a more dangerous situation, with prisons grossly overcrowded and understaffed, the service propped up by overtime payments and hard-pressed officers desperate enough to use suicidal prisoners as bargaining chips."