Electromagnetic inverse profiling for plasma diagnostics in compact microwave-based ion sources