Melancholy implies a temperament behind it — a disposition, historically even a humour. Toska at its deepest has nothing behind it, and that emptiness is what English fixates on — though in everyday Russian it is just as often aimed at something particular. It's an ache that need not come with a cause attached, which is why it can sit at either end of a scale from anguish to boredom.
Side by side
Aspect
Toska
Melancholy
Has a cause
Often none
Implied
Range
Anguish to boredom
Narrower
Is a
State
Temperament
Everyday word
Yes
Less so
What each one means
Toska
Toska is a heavy ache of the soul, running anywhere on a scale from spiritual anguish to plain boredom. At its deepest it has no object at all; in everyday Russian it is just as often aimed at something particular — a place, a person, a time.