Fermionic dark matter via UV and IR freeze-in and its possible X-ray signature