Even in your worst case scenario you've presumably gotten some benefit from the employee before they depart and spent less than you would on a bad hire who has the desired skills (and therefore makes more).
If the result of your investments really is competitors with better trained employees then you have a higher skilled pool to recruit from when you need it. Plus, you've saved money in the meantime.
If companies really wanted to preserve talent for the long term, however, they should look long and hard at aggressive outsourcing programs that evacuate all technical and operations expertise to offshore companies. This has been "training competitors" for decades. There will be a comeuppance for this someday.
People are getting paid to provide labor, not to be serfs.
On pharmacy I worked at trained their own pharmacy technicians. You can go to school for it and get a license. If you train at the pharmacy, however, it is not transferable to a competitor.
Some companies have contracts, stating that you must work at the company for x years after completing training. Occasionally there will be money to pay back. This is exactly so the company feels it can get some of its training investment back. I've seen this quite a bit with education reimbursement and management training programs.
You can also simply make your workplace a horrible place to work. Treat employees well, don't take advantage of employees-in-training, give vacations and be reasonable. You know, normal stuff.
Here's the story:
http://www.latimes.com/local/lanow/la-me-dwp-audit-20170328-...