I think that there might be a difference as to importance between road and trail bike since one is generally steering a MTB more than a roadie. I can only speak for road bikes since that is what I primarily ride.
Over the 35 years that I've had my Fuji, I have found that I wear out rear tires twice as fast as front tires for whatever reason, so in the OPs case I say the rear tire should be replaced first. Flats seem to happen in a similar ratio, usually from tire cord wire rather than glass or sidewall bruises. Very rarely do I have a for-real blowout - maybe four or five in 35 years and only once on the front - so that 'front tire catastrophic failure' does not weigh heavily on my mind.
__________________
'75 Fuji S-10S bought new, 52k+ miles and still going!
'84 Univega Gran Tourismo
'84 Univega Viva Sport
'86 Miyata 710
'90 Schwinn Woodlands
Unknown brand MTB of questionable lineage aka 'Mutt Trail Bike'
Plus or minus a few others from time-to-time