Quantum simulation of thermodynamics in an integrated quantum photonic processor