The words are not synonymous. Hence, you cannot interchange the two words in any of your sentences. Explanations have already been given in the other answers.
I just want to add that you can often replace the words but then you change the meaning significantly. Stephie's and Emanuel's answers give some nice examples but they didn't mention it.
Example 1:
Die Arbeit ist fertig. (Wir können das Produkt an den Kunden ausliefern.)
Die Arbeit ist vorbei. (Ich geh jetzt nach Hause und leg mich auf die Couch.)
The first sentence conveys that you finished your work (~task, project, ...). You can deliver your product to the customer.
The second one, in contrast, refers to the working time and that it is over. (~Feierabend). You didn't finish your project and you'll continue on that the next day, but for today you won't do anything more. You'll relax instead.
Example 2:
Das Essen ist fertig. (Du kannst essen kommen.)
Das Essen ist vorbei. (Du bist zu spät.)
The first sentence conveys that you prepared the food. You can eat now.
The second one, however, refers to the mealtime and that it is over. Everyone else has already eaten and you are too late.