You can build a raised bed from almost any material you like, as long as it is sturdy and does not contain harmful chemicals. Do not use pressure-treated lumber (including railroad ties) because it contains toxins that can leach into the soil. Bricks, cement blocks, and untreated lumber are all suitable for framing.
Even cheap pine boards can be used to frame a bed. Pine, however, is not rot-resistant, so you’ll have to replace it after four years or so. The boards will last longer if you first paint them with raw, not boiled, linseed oil. I used untreated 1-by-10 inch pine for the beds in my herb garden. After one season the wood turned from boring beige to graceful gray. I paved the paths between beds with pea gravel, and then enclosed the entire garden with wire mesh attached to pressure-treated posts.