If routerB is up but its link to ISP is down, there is no way for routerA to learn this and that route-map can prevent it, unless there is HSRP configured on routerB and routerA's next-hop is set to HSRP address. And in HSRP you configure tracking of your ISP serial link and if it is down, it will also bring down the link to routerA so that routerA knows that the uplink is down.
Alternatively, you can also set 2 next-hop's in your policy routing, if one is not reachable, down, it will use the 2nd next-hop address.
HTH
R/Yusuf