Four men who tried to burgle an ATM at Lancaster station have been jailed following a British Transport Police investigation.