I see, same logic using the API then.
You can integrate a script on the JobA that matches that condition (JobA is ready), detect the JobB execution ID (using the ?status=scheduled flag), abort that execution, and then, run the JobB immediately.
Alternatively, you can abort the execution and re-schedule to run immediately. But all ways require to kill the JobB "pending" execution.
Greetings.