During the landing rollout the airplane's right brake failed and the airplane departed the runway into a ditch, and subsequently impacted a fence. The airplane came to rest in an upright position and the student pilot was able to exit the airplane unassisted. During the accident the airplane's wings sustained substantial damage. The pilot reported that prior to initial taxi for the practice flight the airplane's hand brake and right brake pedal felt "spongy." Both became firm after he pumped them several times. Before the engine run-up the student pilot again attempted to activate the hand brake; however, he was only successful after pumping it several times. The pilot then elected to takeoff.