Maximal quantum entanglement at exceptional points via unitary and thermal dynamics