Are Raw Materials stored lost?
You have to either move them to an appropriate power plant or lose them, if you cannot store them. From the Rulebook, p. 3, emphasis mine:


  During the game each player can have only 3 power plants at any time.
  When a player buys a fourth plant, he must discard one of his other
  power plants. The player may move resources from the discarded power
  plant to his remaining three power plants, if they match the
  resources used by one or more of the retained power plants. If there
  is no capacity left or no matching power plant for the resources from
  the discarded plant, the player returns the resources to the
  supply (not the resource market).


Please note that, even if you can store the resources elsewhere, you are not obliged to. You may still want to build over that power plant and lose the resources, if you are planning to buy them out in this round. This has been clarified by the official 2F-Spiele FAQ:


  Q: May a player dump fuel that could be moved? A player was buying an oil plant, and discarding a coal plant along with its fuel. He
  didn't want to move fuel to his hybrid plant because he was going to
  corner the market in oil. Corollary: He could have transferred coal
  from the hybrid to the coal plant just to dump it. 
  
  A: Yes. You are not obliged to move them.


Example 1: You have plants #04 (coal), #13 (eco), #21 (hybrid). The #04 plant has 2 coal tokens on it. You buy the #26 plant (oil), wishing to build over the #04. You may either:


Move first the coal tokens on the #21, thus preserving them, and then build over the #04.
Keep the coal tokens on the #04 and build over it, thus losing them.


Example 2: On the same token, if you have plants #04 (coal), #13 (eco), #14 (trash) and you build the #25 (coal) over the #04, you can first move any coal tokens from the #04 onto the #25 that you just purchased. You are not forced to do it, though. This has been discussed here.

Please take a look at the Power Grid FAQ on BGG for similar questions that might come up during gameplay.