Plans to cut the hours of cleaning staff at Stormont and replace them with robots are a “direct attack on workers”, a trade union has said.