Two young men are accused of a brutal attack on two off-duty police officers that was caught on CCTV, a court has been told.