A federal judge’s finding that extreme heat in Texas prisons is unconstitutional could lead to the state being ordered to spend billions to install air conditioning to cool them off.