They are a little bit different.
If you are working on something and another thing catches your attention, you can say that you were distracted.
Examples:
- I was distracted from my homework when a pretty girl walked by.
- He would not be good for the project because he is too easily distracted.
So, being distracted means that you lose focus on your work.
Being sidetracked means that you've just decided to move on to another project from some reason or another. Maybe something more important came up.
- I didn't end up finishing painting my car, because I got sidetracked with a brake job.
- We were going to rake the leaves, but got sidetracked with a bunch of other projects.
Hope this helps!