You're using analog pins A4 and A7 (int rpm_freq = A4; int speed_freq = A7;) for reading frequency signals with interrupts, but analog pins don't support interrupts on most Arduino boards, including the Nano. That's why your ISR functions never trigger, and both speed and RPM stay zero. Use digital pins that support interrupts, like D2 or D3 on Arduino Nano.