Agriculture 4.0 has transformed farmers' outlooks with the advent of digital technologies and smart farming applications, offering the promise of improved agricultural techniques and sustainable crop practices. These applications rely on advanced technologies like artificial intelligence, edge computing, big data, and the internet of things (IoT), necessitating robust network services with low latency, high bandwidth, and uninterrupted connectivity. However, rural communities often find themselves neglected by network service providers due to their sparse population density. Although optical fiber-based communication (OF) serves as the standard for broadband, its high installation costs render it unsuitable for rural middle-mile connectivity. In recent years, alternatives such as fixed wireless and free-space optics (FSO) have emerged, yet they face technical challenges hindering their full replacement of OF. To address the need for cost-effective middle-mile connectivity in rural areas, this study proposes three heterogeneous broadband-access network topologies that integrate OF, fixed wireless, and FSO technologies. Through optimization, the appropriate technologies are chosen for individual segments to maximize the network operator's profit while meeting the minimum bandwidth requirements for each rural cluster. Simulations utilizing real-life data from eight target rural population clusters compare and determine the optimal middle-mile and last-mile connectivity solutions, achieving annual returns-on-investment of $11.18%$ for ring topology, $17.19%$ for star topology, and $10.81%$ for wheel topology, while ensuring the desired bandwidth levels for each cluster.