Hello and hope you are doing well.
The raised and painful gums could be due to an impacted tooth. The common causes for ear pain ear cerumen (ear wax) impaction, otitis interna (inner ear infection), otitis externa and inflammations. The lymph nodes could be enlarged as a consequence to this. A detailed ENT exam could help determine the cause. Consult your doctor. In the meantime, you can use OTC Acetaminophen for relief from pain.
Hope this helped and do keep us posted.