How to use the ultrasonic sensor on mindstorm NXT
It's a little unclear from your question where this is currently failing, but I do see a couple issues with your code.

1. Your if blocks are probably not doing what you expect. You should include braces to conditionally run the block following an if statement. As written, all of your code executes all of the time. This is a tricky bug to spot, as it looks correct, but isn't. You probably want to change this:

if (us1.getDistance() &gt;= 25);
    Motor.A.setSpeed(50);
    Motor.C.setSpeed(50);
    Motor.A.forward();
    Motor.C.forward();


To this:

if (us1.getDistance() &gt;= 25) {
    Motor.A.setSpeed(50);
    Motor.C.setSpeed(50);
    Motor.A.forward();
    Motor.C.forward();
}


2. You say that you want the motors to stop, but it looks like you are actually reversing them. You'll likely want to change this:

Motor.A.backward();
Motor.C.backward();


To this:

Motor.A.stop();
Motor.C.stop();


Your code may still need some tweaking, but hopefully those two fixes get you back on track.