When the brake peddle is released the piston in the master cylinder should move to a position that opens up the brake lines to the fluid resevoir.I would eliminate the master cylinder first. There is a valve within it that is supposed to allow brake fluid back into the master after you release the brake pedal. That could have failed.