break torque problem

i am using unity 5.3.5 controlling a car by car script in c#
but get error when using breaktorque applied
motor torque not working correctly
if i hit “w” key it goes forward but when hit “x” brake torque applied
and again i hit “w” key it goes backward instead of going forward
if any unity physics guru can help
see script below

using UnityEngine;
using System.Collections;

public class car : MonoBehaviour {
public WheelCollider w;
public WheelCollider ww;
public WheelCollider www;
public WheelCollider wwww;
public GameObject xx;

//public List<AxleInfo> axleInfos;
//public float maxMotorTorque;
//public float maxSteeringAngle;

// Use this for initialization
void Start () {
	

}

// Update is called once per frame
void FixedUpdate () {
	//float motor = maxMotorTorque * Input.GetAxis("Vertical");
	//float steering = maxSteeringAngle * Input.GetAxis("Horizontal");

	w.motorTorque = 500* Input.GetAxis("Vertical");
	ww.motorTorque = 500*Input.GetAxis("Vertical");
	www.steerAngle = 30 * Input.GetAxis ("Horizontal");
	wwww.steerAngle = 30 * Input.GetAxis ("Horizontal");



//	GetComponent<Rigidbody>().AddTorque (10, 0, 0 ,ForceMode.Acceleration);
	
		//GetComponent<WheelCollider>().motorTorque (0, 0, 10, ForceMode.Acceleration);
	//f1.motorTorque  = 150 * Input.GetAxis("Vertical");
		//xx.transform.Rotate (60, 0, 0);
//	f2.motorTorque  = 150* Input.GetAxis("Vertical");
//	f3.motorTorque  = 700.2f;
	//f4.motorTorque  = 700.2f;
		print ("hello");
		Debug.Log (w.rpm);
	                        
	//if (Input.GetKey("")) {
	//	//transform.Translate (1*Time.deltaTime, 0, 0);
	//	w.motorTorque  = -400.0f;
	//	ww.motorTorque  = -400.0f;
	//	www.motorTorque  = -400.0f;
	//	wwww.motorTorque  = -400.0f;

	//	print ("hello");
//	}
	if (Input.GetKey ("x")) {
		//f1.brakeTorque  = 500.0f;
	//	f2.brakeTorque  = 500.0f;
		w.brakeTorque = Mathf.Infinity;
		ww.brakeTorque= Mathf.Infinity;
		Debug.Log ("brakes applied");
	}

}
}

@aldonaletto