This could be electrical but it can also be a failed hard part in the transmission. This will require a hands-on inspection. Use this link to find a good shop near you.
https://repairpal.com/repair-shops
Alex
RepairPal Certified shops can diagnose and repair your 1997 INFINITI QX4. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.