Rape victims will have the chance to challenge a prosecutor's decision to drop their court case for the first time under a new pilot.