Some things to consider…
1.) Before having rifles it would be unwise to mess with a neighboring Khmer with ivory. Think about it, construction and horseback riding come a long time before rifling and military tradition. And since they can hone in on your mounted units, a pike man isn’t adequate protection. Anyways, an elephant with a melee promotion can take out a pike man. I had Khmer as a neighbor, they got their Ballistas pretty early and I was glad I was friendly with them.
2.) The Ballista elephant’s trait of seeking and destroying the mounted unit in a stack is the only unit in the game that has this seek and destroy trait. I’m figuring that’s got to be worth something.
3.) Keep them in your border cities. If any foe comes at you with any mounted unit before cavalry, boom, 1 invasion unit automatically dead. Since Khmer is creative it’s unlikely that a mounted unit could reach your city on the same turn they declare war.
4.) The idea of using elephants for warfare is really cool / fun. The idea of putting giant crossbows on them is even cooler / funner.
I often “customize” or “personalize” my civs. I played and one as Khmer on prince but renamed them “Stankonia.” The people of Stankonia excelled at reproducing and making cool music (EXP/CRE). They weren’t the most productive (actually they were because of their superior population) or academically inclined people since I was playing on Prince (I think we can guess the explanation of this, they spent a lot of their time partying, and, er, “chilling.”
They were one of my most endearing and charming civilizations, in part because they did not have ivory. I imagined my top military scientists, um, “chilling” and being like “I have an idea for a great military advantage. So we take elephants, right…”
“Sir, we have no elephants to speak of,”
“Just listen to me man. So, if WE DID HAVE elephants though, we could put giant crossbows on them…”
“Sounds awesome. I don’t even know where you are going with this, but I fully support this idea, sir.”
Eventually I got someone to trade ivory with me. It was before shortly before my neighbors had rifles and military tradition so it wasn’t useless.