Can both viruses and bacteria cause encephalitis?

Yes. Encephalitis just means an infection of the brain. Meningitis is an infection of the outer coating that protects the brain. Meningo-encephalitis is the combination of the two. Bacteria usually go first to the meninges but can then progress into the brain. Viruses usually go first to the brain but may set up a inflammation of the meninges as well.
Sure. Yes both viruses (herpes and west nile) and bacteria ( bacterial sepsis with microabscess) but clearly more associated with viral causes.