Para parar b.service antes de a.service , você precisa realmente pedir b.service após a.service , pois a ordem na hora da parada do serviço é o inverso da ordem no início tempo.
Então, isso deve ser suficiente para realizar o que você descreveu:
# b.service unit file [Unit] Description=... After=a.service [Service] ...
Veja a documentação para After= in man systemd.unit , que afirma:
Note that when two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. i.e. if a unit is configured with
After=on another unit, the former is stopped before the latter if both are shut down.
Você também perguntou sobre o que acontece se b.service demorar pelo menos 20 segundos para ser encerrado. Está bem. Se b.service estiver configurado corretamente, o systemd poderá monitorá-lo até que a parada da unidade seja concluída (em outras palavras, se ExecStop= não estiver de alguma forma configurada incorretamente) e parar antes do tempo limite ser atingido (consulte TimeoutStopSec= ), em seguida, o systemd esperará até que b.service seja completamente interrompido antes de inicializar o encerramento de a.service .