Can you be more specific than "not working"?
Did the pedal just go down and nothing happened at all? This would very rare. Almost certainly the linkage to the pedal coming off and probably an easy fix.
Or did one back wheel lock up and the other kept spinning, which usually results in not stopping and tearing up grass. In this case, it is the linkage connecting the brake to the differential lock that is probably loose or broken. This linkage activates the differential lock as you step on the brake pedal, which allows the brakes to apply to both back wheels. Most inexpensive lawn tractors do not have this feature, so you may recognize it from other equipment.
Or did both back wheels brake and the front wheels kept spinning? This would be normal unless you're in 4wd. if you are in 4wd, the mechanical drive connection will stop which essentially brakes the front wheels too. But if you're not in 4wd, the front wheels do not have independent brakes. This is one of the many reasons you should always use 4wd when working on hills, wet/loose terrain, or hauling heavy loads.