Determination of molecular energies via variational-based quantum imaginary time evolution in a superconducting qubit system