I have leveled the area between our building and the fenced property boundary, removing soil next to the brickwork, which required me to work around four fence posts. Now, I plan to build a modular brick retaining wall to enclose the exposed rocks and soil. However, I do prefer not to build the retaining wall around the post bases to minimize the reduction in the area width, as it is already quite narrow (approximately 1.5 meters or 4 feet). If the fence posts are not a concern, I can construct the retaining wall directly beneath the timber sleepers at the base of the fence. Is there any way to secure these posts while maintaining a low profile for the retaining wall (maximize the gap between the retaining wall and the building)? By the way, the neighbor's concrete driveway extends right next to the fence covering the post bases.
Your proposed retaining wall will not just "enclose the exposed rocks and soil". It has to support the lateral loads from the soil behind it, and also from vehicles on the neighbor's driveway. Building codes differ from place to place, but they commonly exempt simple retaining walls from permit requirements if they are less than 3 or 4 feet tall. However, that exemption does not apply if they are supporting a surcharge load, such as vehicles on a driveway. Even though it's not very tall, it will likely require a building permit and an engineered design.