Identifying a two-state Hamiltonian in the presence of decoherence