An accurate understanding of the interplay between random and deterministic processes in generating extreme events is of critical importance in many fields, from forecasting extreme meteorological events to the catastrophic failure of materials and in the Earth. Here we investigate the statistics of record-breaking events in the time series of crackling noise generated by local rupture events during the compressive failure of porous materials. The events are generated by computer simulations of the uniaxial compression of cylindrical samples in a discrete element model of sedimentary rocks that closely resemble those of real experiments. The number of records grows initially as a decelerating power law of the number of events, followed by an acceleration immediately prior to failure. The distribution of the size and lifetime of records are power laws with relatively low exponents. We demonstrate the existence of a characteristic record rank k * , which separates the two regimes of the time evolution. Up to this rank deceleration occurs due to the effect of random disorder. Record breaking then accelerates towards macroscopic failure, when physical interactions leading to spatial and temporal correlations dominate the location and timing of local ruptures. The size distribution of records of different ranks has a universal form independent of the record rank. Subsequences of events that occur between consecutive records are characterized by a power-law size distribution, with an exponent which decreases as failure is approached. High-rank records are preceded by smaller events of increasing size and waiting time between consecutive events and they are followed by a relaxation process. As a reference, surrogate time series are generated by reshuffling the event times. The record statistics of the uncorrelated surrogates agrees very well with the corresponding predictions of independent identically distributed random variables, which confirms that temporal and spatial correlation in the crackling noise is responsible for the observed unique behavior. In principle the results could be used to improve forecasting of catastrophic failure events, if they can be observed reliably in real time.