A compact back-end module for high-rate multielement X-ray spectrometers and γ-ray imagers