Yes it will work as long as they are hot wire trained. A good electric fence will stop cattle faster than a 5 strand barb wire fence most times. I would use high tensile wire and make it permanent. Make sure you use insulators on each fence post.
The key to a good electric fence is your ground, and I usually use 4-5 ground rods at least 7 feet in the ground (depending on your area) and get a good fencer . Our whole place is separated by hot wire and my bull pen is enclosed mostly by hot wire and I never have a problem.