I think they both could serve the same purpose ,both being a land to rear livestock and cattle and to cultivate food in general .
The 'farm' however is more specialized in cultivating vegetables, fruits and plants ,while rearing some livestock such as poultry and other animals kept for domestic uses.
The 'ranch' ,being more of an American term is usually equipped with the necessary personnel and buildings for rearing livestock ,cattles in particular.