They say the suspects were caught by villagers in the Bihar state as they were trying to load a buffalo and a calf onto a lorry on Friday morning.
This is the latest in a spate of "cow vigilante" attacks that have provoked alarm among religious minorities and socially underprivileged classes.
Hindus consider cows sacred and killing them is taboo.
Three villagers were later arrested in connection with the lynching.
Critics have accused the governing Hindu-nationalist BJP of not doing enough to rein in such violence.