According to Paul Dini, who should know, having just dined with Bruce Timm (Justice League Unlimited) and Glen Murakami (Teen Titans), the end of JLU and Titans wasn't related to ratings, which were just fine. He stopped just short of saying what it was related to, though he hinted it was increased "territoriality" regarding certain DC characters. As a character and his/her corresponding villains are optioned for another series or movie, their availability for other purposes is limited. I'll point out that all of DC's Big Three (Superman, Batman, and Wonder Woman) are on, or headed for, the Big Screen. And that Batman and his various signature villains (most notably the Joker) are concurrently appearing in The Batman over on WB.
There's also the widely-held belief that no animated series really needs to run beyond 65 episodes (which allows it to be "stripped"--run five-a-week for 13 weeks), since "kids don't care about reruns". The last two years of JLU were borrowed time.
On the other hand, there are plenty more animated DC shows in various stages of development, and if the last three years of JLU have taught us anything, it's that the DC Universe is a rich and diverse place. Doom Patrol and Plastic Man have been mentioned, and "Supergirl and the Legion of Super Heroes" is a likely candidate. A Teen Titans movie has been announced: I wouldn't be too surprised to hear a JLU movie is being planned as well.