There is little difference in the function as hearsay, but らしい tells the speaker's "interpretation" of the fact, while そうだ is mentally a quote to the speaker, that needs to be kept faithful to what they originally heard.
What I mean is:
X: Aさんも参加するんですか? Will A-san join us?
Y: その日は病院に行くって言ってました。 S/he said s/he'll see doctor that day.
X:
- Aさんは病院(○ らしい/○ だそう)です。
- Aさんは病院に行くので来れない(○ らしい/△ そう)です。
- Aさんは来れない(○ らしい/× そう)です。
On the other hand, らしい is not suitable when the source is perfectly reliable:
X: Aさんも参加するんですか?
A: その日は病院に行きます。
X: Aさんは病院(× らしい/○ だそう)です。
Bonus: never confuse [dictionary form] + そう and [masu-stem (連用形) / stem] + そう. The latter tells what the speaker collects from their direct sensation (look, sound, taste, ...).
hearsay sensation
行くそうだ 行きそうだ
おいしいそうだ おいしそうだ
きれいだそうだ きれいそうだ