I took my young son on my road bike with me when I was getting ready to try for my first century (100 mi). His bike seat wrapped around him, and with his little helmet, he felt quite secure from any threat.
However, he always alerted me to any dog that was tall enough to reach him. "Dad, dad, dog dog dog. Go Faster!"
One particular afternoon, after a big stray lab had chased us week after week (on the way home, when I was tired, not on the way out, when I could leave him in the dust), I decided to take matters into my own hands. I got a mace pen, left my son at home, and went for a ride. On the way back, the lab took off after me. I had not been out long, and decided, dog, you are going to get it. He came out, paced me, angled in, and I whipped out the mace and let loose.
No one ever told me those pens have the pitiful little stream that came trickling out, or that the wind would blow it all over my hand. I did hit him, but only after I leaned over so far I nearly went into the ditch, and threw the stupid pen after him. The laugh was on me, when that evening I took my contacts out.
I never understood why I never though of the solution myself. One of the older kids told me to give my son a bag of small rocks. He had a good arm.
End of lab chasing us. (My four year old never hit him, but the possibility was there). A series of salvos kept the lab on the yard the next pass, but my new tail gunner kept a careful eye, which later proved valuable when an early ride surprised some coyotes.
In all seriousness, on public roadways, a small paint ball gun (check local ordinances / regulations) and aimed at the rear of the dog might be in order if you are in danger of being injured. If you injure the dog, you might be liable, but not in Texas, if the dog is after you. (In Texas, you could even be licensed to carry a 9mm semi-automatic, concealed, with the proper classes and permits, and that is the end of doggie, if it is a threat and you are on a public street). I recommend stopping the bike before taking aim, in case he decides to run back home. If he comes after you, after injuring your before, if you've had the training, drop him, call the police, and wait for them to arrive. (Be sure to have a copy of your permit and id with you).
Don't leave before they get there, otherwise, you and your attorney will be busy.
Have you thought about have an attorney call this dog's owners? And explain, in detail, how much his could cost them? That might be cheaper and less 'personal' (and better for the dog).
My own dog runs and barks at me each time I ride in, but he's only a foot tall, so who cares. He's never learned. I learned to keep him locked up if it bothers me. That dog's owners might be motivated by an attorney to keep him locked up as well.