You’re right that these are quite similar. Per the OED, alleviate is
To lighten, or render more tolerable, or endurable; to relieve, mitigate
While in (non-)contrast, ameliorate is
To make better; to better, improve.
There is also an intransitive sense for ameliorate, where it means “to grow better” rather than “to make better”.
I may be wrong, but my instinct of contemporary usage is that one is more apt to employ alleviate when the problem is completely resolved, and ameliorate when it is improved but not necessarily removed altogether.
Since the two words can in fact, or at least in theory, be used interchangeable, it is probably best not to assume anything, and to spell out just what you mean if there is any question.
Here are some OED citations for ameliorate:
- 1813 Sir H. Davy Agric. Chem. 203 ― A sterile soil··may be ameliorated by the application of quick lime.
- 1849 Macaulay Hist. Eng. I. 279 ― In every human being there is a wish to ameliorate his own condition.
- 1882 Geikie in Macm. Mag. Mar. 365/2 ― [Man]··would find his way back as the climate ameliorated.
And here are some for alleviate:
- 1712 Steele Spect. No. 450 ⁋3, ― I··found means to alleviate, and at last conquer my Affliction.
- 1871 Napheys Prevent. Dis. ɪɪɪ. ii. 619 ― To alleviate the sufferings of the invalid.
- 1876 Mozley Univ. Serm. ᴠ. 120 ― Hope alleviates the sorrow of that home.
If you are looking for a fine distinction, there is something “uplifting” about alleviate that does not quite occur in ameliorate, which is simply to improve.