For overall durability, especially if it may get wet, cocobolo is probably the better choice. The high oil content works in its favor.
For years I have seen those janka hardness listings that show ebony at 3220 and cocobolo around 1136, and took it as the truth. However, someone challenged me on it once, saying that the 1136 value was an error that has been spread around the internet (and one large wood database clearly says that they feel it is an error, that cocobolo should have comparable or higher janka hardness than ebony) and I had to devise my own experiment.
So, I took some cocobolo and some ebony, and put all my weight on a phillips head screwdriver to see how far into the wood I could push it. To my complete surprise, I could make a very small impression in the ebony, but none at all in the cocobolo. Based on that, I would have to agree that the widely published cocobolo janka hardness of 1136 is incorrect.
There are other things to consider besides janka hardness (as stated above, water resistance may or may not be important to you). One thing that I have noticed is that cocobolo is easier to cut with a bandsaw than ebony. Whether this is because of the lubrication property of the oil content I can't say. Cocobolo may be more resistant to denting (see above) but less resistant to abrasion.
Anyway, those are my personal observations. However, both cocobolo and ebony are so much more durable than woods like oak, maple, hickory, etc, that you really only need to pick which one you like better. I have century-old antique slipjoints with cocobolo and ebony, some of which obviously saw plenty of use with little left of the sharpened-down blades, and the wood has held up just fine.
To add to the options, african blackwood is actually a rosewood (dalbergia) like cocobolo, and may be even more durable. And don't forget lignum vitae. If you want a super-durable wood handle, look no further. They even used lignum vitae for propeller shaft bearings in US submarines in WWII. An inexpensive alternative is ipe, which is probably more durable than ebony or cocobolo (it is noted as exceptionally resistant to weathering, and is harder than those woods, too), and some pieces look a lot like walnut.